You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppress duplicated key event handling in Linux/GTK3 #4199
On GTK (Linux), a single physical key press can, in some situations, be
delivered to KeyBindingDispatcher twice for the very same native event:
once synchronously via an SWT.Traverse event dispatched from within the
native gtk3_key_press_event handling, and once more later via the async
message queue. Both deliveries resolve to and execute the exact same
bound command, which for page-traversal shortcuts like Ctrl+PageUp /
Ctrl+PageDown (Next/Previous Editor) causes an extra tab to be skipped,
since the CTabFolder selection is advanced twice per key press.
This does not reproduce on Windows or macOS, only on GTK.
Fix: track the last executed command together with the native timestamp
(Event#time) of its triggering event in executeCommand(...), and skip
(without re-executing the handler) a call that matches both the same
command and the same event timestamp, since that combination can only
happen when the very same native key event is redelivered. Genuinely
distinct key presses - including fast auto-repeat - always carry
different timestamps, so normal navigation and repeated shortcuts are
unaffected.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes#4199
0 commit comments