diff --git a/crates/ui-egui/tests/it/commands.rs b/crates/ui-egui/tests/it/commands.rs index 2b2603ca37..d52cf040f9 100644 --- a/crates/ui-egui/tests/it/commands.rs +++ b/crates/ui-egui/tests/it/commands.rs @@ -285,16 +285,18 @@ fn shortcuts_run_registered_commands() { #[test] fn ctrl_m_opens_the_comments_panel_and_keeps_it_open() { let mut h = harness(); + // Press it as Windows and Linux send it: Ctrl sets both `ctrl` and `command`, so a + // Cmd+Ctrl+M binding would also match and must not take it. + h.ctx.set_os(OperatingSystem::Windows); h.state_mut().right = None; h.run_steps(2); - h.key_press_modifiers(Modifiers::COMMAND, Key::M); + h.key_press_modifiers(Modifiers::CTRL | Modifiers::COMMAND, Key::M); h.run_steps(2); assert_eq!(h.state().right, Some(pdfcraft_ui_egui::RightPanel::Comments)); // Pressed again it opens, not toggles (#3741). - h.key_press_modifiers(Modifiers::COMMAND, Key::M); + h.key_press_modifiers(Modifiers::CTRL | Modifiers::COMMAND, Key::M); h.run_steps(2); assert_eq!(h.state().right, Some(pdfcraft_ui_egui::RightPanel::Comments)); - h.ctx.set_os(OperatingSystem::Nix); h.state_mut().execute("help.shortcuts"); h.run_steps(3); h.get_by_label("Ctrl+M");