Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/macos/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,18 @@ impl KeyboardState {
return None;
}
}
_ => unreachable!(),
// AppKit occasionally dispatches non-key events into
// `keyDown:` / `keyUp:` / `flagsChanged:` selectors
// (e.g. `NSAppKitDefined`, `NSSystemDefined`, or sync
// events around Cmd-Tab and input-source switches).
// Panicking here crosses the `extern "C"` boundary as
// `panic_cannot_unwind` and aborts the hosting process,
// which has been observed crashing plug-in hosts when
// the focused view is a baseview `NSView`. Drop the
// event silently instead; the handler has nothing
// meaningful to synthesize from an event that isn't
// a key or flags-changed.
_ => return None,
};
let is_composing = false;
let repeat: bool = event_type == NSEventType::NSKeyDown && msg_send![event, isARepeat];
Expand Down