@@ -352,15 +352,17 @@ var Workspace = class Workspace {
352352 windowRemoved ( metaWorkspace , metaWindow ) {
353353 if ( ! this . state ) return ;
354354
355- if ( ( metaWindow . is_on_all_workspaces ( ) || this . state . settings . showAllWorkspaces
356- || ! this . state . settings . showAllWorkspaces )
355+ // Abort the remove if the window is just changing workspaces, window
356+ // should always remain indexed on all workspaces while its mapped.
357+ // if (!metaWindow.showing_on_its_workspace()) return;
358+ if ( ( this . state . settings . showAllWorkspaces ) && ( metaWindow . has_focus ( )
359+ && global . workspace_manager . get_active_workspace_index ( )
360+ !== metaWorkspace . index ( ) ) ) return ;
361+
362+ // If the window is on all workspaces or we're showing all workspaces,
363+ // make sure to remove the window from all workspaces.
364+ if ( ( metaWindow . is_on_all_workspaces ( ) || this . state . settings . showAllWorkspaces )
357365 && ! this . state . removingWindowFromWorkspaces ) {
358- // Abort the remove if the window is just changing workspaces, window
359- // should always remain indexed on all workspaces while its mapped.
360- // if (!metaWindow.showing_on_its_workspace()) return;
361- if ( ( this . state . settings . showAllWorkspaces ) && ( metaWindow . has_focus ( )
362- && global . workspace_manager . get_active_workspace_index ( )
363- !== metaWorkspace . index ( ) ) ) return ;
364366 this . state . removingWindowFromWorkspaces = true ;
365367 this . state . trigger ( 'removeWindowFromAllWorkspaces' , metaWindow ) ;
366368 return ;
0 commit comments