From 74ede9827a19fee4c80d390c01002cbc03671d83 Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 10 Jul 2026 10:35:14 +0000 Subject: [PATCH] Remove necessary workarounds --- desktop/ui/src/input.rs | 15 --------------- desktop/ui/src/remote/host.rs | 7 ------- 2 files changed, 22 deletions(-) diff --git a/desktop/ui/src/input.rs b/desktop/ui/src/input.rs index b1c6e40d15..a98b72cc48 100644 --- a/desktop/ui/src/input.rs +++ b/desktop/ui/src/input.rs @@ -150,22 +150,7 @@ pub(crate) fn translate(input_state: &mut InputState, event: &WindowEvent) -> Ve kind = KeyEventKind::Char; } - // Mitigation for CEF on Mac bug to prevent NSMenu being triggered by this key event. - // - // CEF converts the key event into an `NSEvent` internally and passes that to Chromium. - // In some cases the `NSEvent` gets to the native Cocoa application, is considered "unhandled" and can trigger menus. - // - // Why mitigation works: - // Leaving `key_event.unmodified_character = 0` still leads to CEF forwarding a "unhandled" event to the native application - // but that event is discarded because `key_event.unmodified_character = 0` is considered non-printable and not used for shortcut matching. - // - // See https://github.com/chromiumembedded/cef/issues/3857 - // - // TODO: Remove mitigation once bug is fixed or a better solution is found. - #[cfg(not(target_os = "macos"))] let unmodified_character = event.key_without_modifiers.to_char_representation() as u16; - #[cfg(target_os = "macos")] - let unmodified_character = 0; #[cfg(target_os = "macos")] // See https://www.magpcss.org/ceforum/viewtopic.php?start=10&t=11650 if character == 0 && unmodified_character == 0 && event.text_with_all_modifiers.is_some() { diff --git a/desktop/ui/src/remote/host.rs b/desktop/ui/src/remote/host.rs index 21607a87d0..cb3d0c26b7 100644 --- a/desktop/ui/src/remote/host.rs +++ b/desktop/ui/src/remote/host.rs @@ -89,13 +89,6 @@ pub(crate) fn run() { } ControlOutcome::Disconnected => std::process::exit(0), } - - // Workaround for a Windows-specific exception that occurs when `context` is dropped. - // Appears to be related to CEF object destruction order. - // Calling `exit` bypasses rust teardown and lets Windows perform process cleanup. - // TODO: Identify and fix the underlying CEF shutdown issue so this workaround can be removed. - #[cfg(target_os = "windows")] - std::process::exit(0); } enum ControlOutcome {