Skip to content

Commit 403c84a

Browse files
authored
Merge pull request #299 from dseomn/switcher-closing-bug
Fix closing the switcher popup on wayland when releasing keys
2 parents a8aed7e + 38def24 commit 403c84a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

[email protected]/workspacePopup/workspaceManagerOverride.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,15 @@ export default class WorkspaceManagerOverride {
467467
});
468468

469469
let event = Clutter.get_current_event();
470-
let modifiers = event ? event.get_state() & Clutter.ModifierType.MODIFIER_MASK : 0;
470+
// gnome-shell's SwitcherPopup.show() seems to expect a modifier
471+
// mask from a configured keybinding, not from an event's state.
472+
// On Wayland, the event's state includes ambient modifiers like
473+
// caps lock and numlock (Mod2) that generally wouldn't be part
474+
// of a keybinding, so we clear those bits so that SwitcherPopup
475+
// can close the popup when the relevant modifiers are released,
476+
// instead of waiting for caps/num lock to be released.
477+
const modifier_mask = Clutter.ModifierType.MODIFIER_MASK & ~Clutter.ModifierType.LOCK_MASK & ~Clutter.ModifierType.MOD2_MASK;
478+
let modifiers = event ? event.get_state() & modifier_mask : 0;
471479
this.wm._wsPopupList[monitorIndex].showToggle(false, null, modifiers, toggle);
472480
if (monitorIndex === Main.layoutManager.primaryIndex) {
473481
this.wm._workspaceSwitcherPopup = this.wm._wsPopupList[monitorIndex];

0 commit comments

Comments
 (0)