From dd334d311b51eb13af5f909ea37591f6e310aded Mon Sep 17 00:00:00 2001 From: ashishkaushik05 Date: Sun, 2 Aug 2026 20:50:15 +0530 Subject: [PATCH] Fix windows from other workspaces ghosting on the current workspace When the switcher opens it hides every window in global.window_group and re-shows them all on close, without checking which workspace they belong to. On GNOME 48+ that leaves windows from the other workspaces drawn on top of the current one as non-interactive ghosts until you switch workspaces and come back. Scope both the hide-on-open and show-on-close loops to the active workspace so windows on other workspaces are left untouched and keep being managed by mutter as usual. --- src/switcher.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/switcher.js b/src/switcher.js index ffe83e4..5438515 100644 --- a/src/switcher.js +++ b/src/switcher.js @@ -209,9 +209,15 @@ export class Switcher { } // hide windows and showcd Coverflow actors + // Only hide windows on the current workspace. Hiding (and later + // re-showing) windows from other workspaces makes them briefly render + // on the current workspace as non-interactive ghosts on GNOME 48+. if (this._parent === null) { + let currentWorkspace = this._manager.workspace_manager.get_active_workspace(); for (let child of global.window_group.get_children()) { - if (child !== global.window_group.get_first_child()) { + if (child !== global.window_group.get_first_child() + && typeof child.get_meta_window === "function" + && child.get_meta_window().get_workspace() === currentWorkspace) { child.hide(); } } @@ -1161,9 +1167,14 @@ export class Switcher { if (this._parent === null) this._manager.platform.removeBackground(); if (this._parent === null) { + let currentWorkspace = this._manager.workspace_manager.get_active_workspace(); for (let child of global.window_group.get_children()) { if (typeof child.get_meta_window === "function") { - if (!child.get_meta_window().minimized) { + let metaWin = child.get_meta_window(); + // Only re-show windows that belong to the current workspace. + // Re-showing windows from other workspaces is what left them + // ghosting on the current workspace after a switch. + if (!metaWin.minimized && metaWin.get_workspace() === currentWorkspace) { child.show(); } }