File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -467,7 +467,15 @@ export default class WorkspaceManagerOverride {
467
467
} ) ;
468
468
469
469
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 ;
471
479
this . wm . _wsPopupList [ monitorIndex ] . showToggle ( false , null , modifiers , toggle ) ;
472
480
if ( monitorIndex === Main . layoutManager . primaryIndex ) {
473
481
this . wm . _workspaceSwitcherPopup = this . wm . _wsPopupList [ monitorIndex ] ;
Original file line number Diff line number Diff line change @@ -190,11 +190,15 @@ class WorkspaceSwitcherPopup extends SwitcherPopup {
190
190
this . _noModsTimeoutId = 0 ;
191
191
}
192
192
193
+ this . _items . forEach ( ( x ) => x . destroy ( ) ) ;
194
+ this . _items = [ ] ;
195
+
193
196
super . _onDestroy ( ) ;
194
197
195
198
while ( modals . length > 0 ) {
196
199
modals . pop ( ) . destroy ( ) ;
197
200
}
201
+
198
202
}
199
203
200
204
vfunc_allocate ( box ) {
Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ export default GObject.registerClass({
42
42
style : `spacing: ${ ITEM_SPACING } ` ,
43
43
} ) ;
44
44
this . _lists = [ ] ;
45
- this . _thumbnails = thumbnails ;
46
- this . _workspaceName = workspaceName ;
47
45
this . _scale = options . scale ;
48
46
this . _showThumbnails = options . showThumbnails ;
49
47
this . _showWorkspaceName = options . showWorkspaceNames ;
@@ -75,7 +73,7 @@ export default GObject.registerClass({
75
73
( ) => this . highlight ( workspaceManager . get_active_workspace_index ( ) ) ) ;
76
74
77
75
for ( let i = 0 ; i < thumbnails . length ; i ++ ) {
78
- this . addItem ( this . _thumbnails [ i ] , this . _workspaceName [ i ] ) ;
76
+ this . addItem ( thumbnails [ i ] , workspaceName [ i ] ) ;
79
77
}
80
78
}
81
79
You can’t perform that action at this time.
0 commit comments