Skip to content

Commit b00e769

Browse files
committed
Merge tag 'v10.1' into patch-1
2 parents acc49a9 + cc38b74 commit b00e769

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
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];

[email protected]/workspacePopup/workspaceSwitcherPopup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,15 @@ class WorkspaceSwitcherPopup extends SwitcherPopup {
190190
this._noModsTimeoutId = 0;
191191
}
192192

193+
this._items.forEach((x) => x.destroy());
194+
this._items = [];
195+
193196
super._onDestroy();
194197

195198
while (modals.length > 0) {
196199
modals.pop().destroy();
197200
}
201+
198202
}
199203

200204
vfunc_allocate(box) {

[email protected]/workspacePopup/workspaceSwitcherPopupList.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export default GObject.registerClass({
4242
style: `spacing: ${ITEM_SPACING}`,
4343
});
4444
this._lists = [];
45-
this._thumbnails = thumbnails;
46-
this._workspaceName = workspaceName;
4745
this._scale = options.scale;
4846
this._showThumbnails = options.showThumbnails;
4947
this._showWorkspaceName = options.showWorkspaceNames;
@@ -75,7 +73,7 @@ export default GObject.registerClass({
7573
() => this.highlight(workspaceManager.get_active_workspace_index()));
7674

7775
for (let i = 0; i < thumbnails.length; i++) {
78-
this.addItem(this._thumbnails[i], this._workspaceName[i]);
76+
this.addItem(thumbnails[i], workspaceName[i]);
7977
}
8078
}
8179

0 commit comments

Comments
 (0)