Created
June 27, 2026 09:16
-
-
Save qnighy/a1647053cc64738ccdbf0749cd1b62bd to your computer and use it in GitHub Desktop.
Patch to fix ibus-skk absorbing Super modifier keys in Wayland
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From: Masaki Hara <ackie.h.gmai@gmail.com> | |
| Date: Sat, 27 Jun 2026 18:09:14 +0900 | |
| Subject: Forward Super/Hyper modified key events to the compositor | |
| When ibus-skk is the active engine, pressing a Super (Mod4) + letter | |
| combo such as Super+L caused the bare letter to be committed and the | |
| event reported as handled, swallowing the compositor's global shortcuts | |
| (e.g. Super+L to lock the screen). | |
| The modifier masking in process_key_event() stripped the Super/Hyper | |
| bits before handing the event to libskk, so libskk saw a bare letter. | |
| SKK binds nothing to Super/Hyper, so return false (not handled) for any | |
| key event carrying those modifiers, letting IBus forward it to the | |
| compositor. This also covers the matching key release. | |
| See https://github.com/ibus/ibus/issues/2608 | |
| Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> | |
| --- | |
| src/engine.vala | 13 +++++++++++++ | |
| 1 file changed, 13 insertions(+) | |
| diff --git a/src/engine.vala b/src/engine.vala | |
| index a55d4ca..0d36bf6 100644 | |
| --- a/src/engine.vala | |
| +++ b/src/engine.vala | |
| @@ -418,6 +418,19 @@ class SkkEngine : IBus.Engine { | |
| uint keycode, | |
| uint state) | |
| { | |
| + // SKK has no keybinding that uses the Super (Mod4) or Hyper | |
| + // modifiers, and the masking below would otherwise strip those | |
| + // bits and let libskk treat e.g. Super+L as a bare "l", which it | |
| + // commits and reports as handled. That swallows the compositor's | |
| + // global shortcuts (e.g. Super+L to lock the screen). Forward such | |
| + // events to IBus/the compositor unhandled instead. This also covers | |
| + // the matching key release. See ibus/ibus#2608. | |
| + if ((state & (IBus.ModifierType.MOD4_MASK | | |
| + IBus.ModifierType.SUPER_MASK | | |
| + IBus.ModifierType.HYPER_MASK)) != 0) { | |
| + return false; | |
| + } | |
| + | |
| // Filter out unnecessary modifier bits | |
| // FIXME: should resolve virtual modifiers | |
| uint _state = state & (IBus.ModifierType.CONTROL_MASK | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment