Skip to content

Fix windows from other workspaces ghosting onto the current workspace - #313

Merged
dsheeler merged 1 commit into
dsheeler:mainfrom
ashishkaushik05:fix-other-workspace-windows-ghosting
Aug 5, 2026
Merged

dsheeler merged 1 commit into
dsheeler:mainfrom
ashishkaushik05:fix-other-workspace-windows-ghosting

Conversation

@ashishkaushik05

Copy link
Copy Markdown

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.js the switcher hides the real windows on open and re-shows them on close, but both loops walk all of global.window_group without checking the workspace:

  • On open it does child.hide() on every window (all workspaces).
  • On close it does 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. The current-workspace-only setting doesn't help because these loops operate on the raw window_group, not the switcher's window list.

Fix

Scope both loops to the active workspace (using the same get_workspace() === currentWorkspace guard already used further down in animateClosed). 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.

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.
Copilot AI review requested due to automatic review settings August 2, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/switcher.js
@@ -209,9 +209,15 @@ export class Switcher {
}

// hide windows and showcd Coverflow actors
@dsheeler
dsheeler merged commit 70c78bf into dsheeler:main Aug 5, 2026
1 check passed
@dsheeler

dsheeler commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Thank you! You beat me to the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants