Split modifier only handling into a dedicated InputEventSpy
ClosedPublic

Authored by graesslin on Feb 11 2017, 8:32 PM.

Details

Summary

The functionality regarding triggering modifier only shortcuts is moved
out of Xkb - where it doesn't belong to - and is turned into an input
event spy listening for the changes it is interested in. Previously
the state got queried by asking e.g. for the pressed buttons, now it's
tracked directly.

The X11 side needs a larger change due to that as now pushing the events
into Xkb does not trigger modifier only shortcuts any more. Instead the
"normal" way through the platform API needs to be used which triggers the
processing of filters and spies.

The problem here is that our redirections only process events if they are
inited and that only happens on Wayland. We cannot call init on them as
that would create all the Wayland filters and spies and processing would
probably break. As an intermediate solution the spies are now processed
and there we know that it won't matter. A future solution would be to
remove the init checks completely and just send through both filters and
spies and ensure that on X11 only the supported ones are loaded.

Closes T5220

Test Plan

Tested on Wayland and X11

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 11239.Feb 11 2017, 8:32 PM
graesslin retitled this revision from to Split modifier only handling into a dedicated InputEventSpy.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptFeb 11 2017, 8:32 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
romangg accepted this revision.Feb 14 2017, 2:14 PM
romangg added a reviewer: romangg.
romangg added a subscriber: romangg.

Didn't find any obvious issues in code plus tested it on X and Wayland.

keyboard_input.cpp
686

Somewhat unrelated to this diff, but can't we get rid of all these m_inited conditions by setting up LibInput via InputRedirection::setupLibInput() and connecting the functions in KeyboardInputRedirection only after m_keyboard->init() and so on in InputRedirection::setupWorkspace() were called?

This revision is now accepted and ready to land.Feb 14 2017, 2:14 PM
graesslin added inline comments.Feb 14 2017, 4:02 PM
keyboard_input.cpp
686

yes, long term I want to get rid of all the inited conditions. One of the main reasons for introducing were crashes during startup. E.g. you start a nested KWin, move the mouse and it tries to access Workspace prior to Workspace being created.

Now with the processing methods not doing anything except delegating to the filters it will be possible. We just need to fix the init of the filters and the methods which currently still do things except processing the filters.

This revision was automatically updated to reflect the committed changes.