Fix windows from other workspaces ghosting onto the current workspace - #313
Merged
dsheeler merged 1 commit intoAug 5, 2026
Merged
Conversation
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.
There was a problem hiding this comment.
Pull request overview
This PR fixes a GNOME Shell (48+) Wayland rendering glitch where windows from other workspaces can appear as non-interactive “ghosts” on the current workspace after using the Coverflow Alt-Tab switcher, by avoiding forced hide/show operations on windows outside the active workspace.
Changes:
- Scope the “hide real windows” loop to the active workspace when opening the switcher.
- Scope the “re-show real windows” loop to the active workspace when closing/destroying the switcher.
- Add explanatory comments documenting the GNOME 48+ ghosting behavior and why the workspace guard is necessary.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -209,9 +209,15 @@ export class Switcher { | |||
| } | |||
|
|
|||
| // hide windows and showcd Coverflow actors | |||
Owner
|
Thank you! You beat me to the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's happening
On GNOME Shell 50 (Wayland) I kept hitting a glitch: every time I trigger the switcher, the windows that live on my other workspaces suddenly appear on top of my current workspace. They're just ghosts — I can't click or focus them, they only render. Switching to another workspace and back clears them, until the next Alt+Tab brings them back.
Cause
In
src/switcher.jsthe switcher hides the real windows on open and re-shows them on close, but both loops walk all ofglobal.window_groupwithout checking the workspace:child.hide()on every window (all workspaces).child.show()on every non-minimized window (all workspaces).That
child.show()on close is the problem — it force-shows windows that belong to other workspaces, overriding mutter's normal per-workspace culling. On GNOME 48+ that stays visible until the next workspace recompute, which is exactly the ghosting + "fine until I Alt+Tab again" behaviour. Thecurrent-workspace-onlysetting doesn't help because these loops operate on the rawwindow_group, not the switcher's window list.Fix
Scope both loops to the active workspace (using the same
get_workspace() === currentWorkspaceguard already used further down inanimateClosed). Windows on other workspaces are simply left alone, so mutter keeps managing them normally — no ghosts, and nothing disappears when you switch to those workspaces.Testing
Tested on GNOME Shell 50.1 / Wayland (Ubuntu 26.04). Reproduced the ghosting reliably before the change; with the patch applied and after a re-login, the ghosts are gone and windows on other workspaces still show up correctly when switching to them. Behaviour on a single workspace is unchanged.