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 {
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 ] ;
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments