Skip to content

Fix Meta+A order issues for Activity switching

Because the activity switcher shows up only after a timed delay, the corresponding SortedActivitiesModel::setInhibitUpdates(true) happened too late to freeze the current order of activities at the time of keypress. This messed up both the display and effective switching order of activities in an unintuitive way.

This commit introduces a call to setInhibitUpdates(true) at the beginning of SwitcherBackend::keybdSwitchedToAnotherActivity(), prior to spawning the sequence of signals and slots that will eventually determine whether the activity switcher should be shown.

SwitcherBackend::setShouldShowSwitcher() in turn is modified to call setInhibitUpdates() indiscriminately, not just when its boolean value is changed. With a simplification of modifier checks, we make sure that SwitcherBackend::showActivitySwitcherIfNeeded() will always call setShouldShowSwitcher() to ensure updates are allowed again after determining whether to show it.

As a related fix, setShouldShowSwitcher() will now only delete the Wayland-specific modifier key input window if we decided not to show the activity switcher. If it remains shown, we still want the input window to stick around so it can continue to query whether e.g. the Meta key is still pressed.

BUG: 419499

Merge request reports