Remove not-wanted modifiers prior to evaluating global shortcuts
ClosedPublic

Authored by graesslin on Sep 14 2016, 8:04 AM.

Details

Summary

When triggering global shortcuts we are more interested in the hold
keys than the currently active modifiers. E.g. capslock should not
be seen as "shift is hold". Similar we need to remove consumed
modifiers. Shift+5 is % and not Shift+% - the shift modifier is
consumed and needs to be removed from shortcut evaluation.

To support this we need to have the actual state directly from
xkbcommon. Thus a new method is added which exposes the modifiers
relevant for global shortcut matching. In addition on every key press
all consumed modifiers are calculated and kept so that they can be
used for shortcut matching.

In addition a workaround is added for Backtab. Similar workaround
exists in kglobalaccel for X11. The problem is that our shortcuts are
stored incorrectly: Shift+Tab instead of Backtab. Thus a mapping back
is required. To make everything worse KWin registers the wrong key
sequence "Alt+Shift+Backtab" which doesn't make any sense and is
broken on X11 at least.

The workaround supports both special cases. The one for Backtab should
be turned into Shift+Tab and also KWin's special case of adding shift
to backtab.

CCBUG: 368581

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 6712.Sep 14 2016, 8:04 AM
graesslin retitled this revision from to Remove not-wanted modifiers prior to evaluating global shortcuts.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptSep 14 2016, 8:04 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
bshah accepted this revision.Sep 14 2016, 8:17 AM
bshah edited edge metadata.
This revision is now accepted and ready to land.Sep 14 2016, 8:17 AM
This revision was automatically updated to reflect the committed changes.