Support modifier only shortcuts on X11
ClosedPublic

Authored by graesslin on Aug 12 2016, 1:26 PM.

Details

Summary

With this change KWin/X11 reuses Wayland's modifier only shortcut
architecture. The XInput2 event filter also listens for

  • XI_RawKeyPress
  • XI_RawKeyRelease

Those events are also reported if another X11 client grabs keyboard
input. Thus KWin gets all key events, just like on Wayland.

All key events are then sent through the Xkb class which performs the
mapping from key codes to key syms and is able to detect whether the
modifier got pressed/released without another key being pressed.

This change will require a few follow up changes, which are required
also for Wayland:

  • ignore if another input device got interacted (e.g. mouse press, touch screen, scroll, etc)
  • ignore when screen is locked (see existing comment)
  • use the layout from XServer instead of using our own (needed on Wayland in nested setup)

The biggest disadvantage of the change is that it triggers a wake
up of KWin on every key event. But as KWin already listens to all
pointer events that's not a big difference and normally a key event
will wake up the compositor any way.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 5876.Aug 12 2016, 1:26 PM
graesslin retitled this revision from to Support modifier only shortcuts on X11.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptAug 12 2016, 1:26 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
sebas accepted this revision.Aug 15 2016, 10:19 AM
sebas added a reviewer: sebas.
This revision is now accepted and ready to land.Aug 15 2016, 10:19 AM
This revision was automatically updated to reflect the committed changes.