Remove necessary workarounds

This commit is contained in:
Timon
2026-07-10 10:35:14 +00:00
parent 24c5cb23ad
commit 74ede9827a
2 changed files with 0 additions and 22 deletions

View File

@@ -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() {

View File

@@ -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 {