mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
macos: halt NSEvent processing at app scope only if event is handled (#4691)
Fixes #4677
This commit is contained in:
@ -430,9 +430,16 @@ class AppDelegate: NSObject,
|
|||||||
ghostty_app_key_is_binding(
|
ghostty_app_key_is_binding(
|
||||||
app,
|
app,
|
||||||
event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)) {
|
event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)) {
|
||||||
ghostty_app_key(app, event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS))
|
// If the key was handled by Ghostty we stop the event chain. If
|
||||||
|
// the key wasn't handled then we let it fall through and continue
|
||||||
|
// processing. This is important because some bindings may have no
|
||||||
|
// affect at this scope.
|
||||||
|
if (ghostty_app_key(
|
||||||
|
app,
|
||||||
|
event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS))) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If this event would be handled by our menu then we do nothing.
|
// If this event would be handled by our menu then we do nothing.
|
||||||
if let mainMenu = NSApp.mainMenu,
|
if let mainMenu = NSApp.mainMenu,
|
||||||
|
Reference in New Issue
Block a user