Skip to content

windowManager.js: Finish the workspace switch when a window closes during the slide - #14153

Merged
mtwebster merged 1 commit into
linuxmint:masterfrom
ruszkidaniel:fix-stuck-workspace-switch
Nov 20, 2026
Merged

mtwebster merged 1 commit into
linuxmint:masterfrom
ruszkidaniel:fix-stuck-workspace-switch

Conversation

@ruszkidaniel

Copy link
Copy Markdown
Contributor

Fixes #14134. Probably also #11409 and #11929.

Problem

If a window is closed while the workspace switch slide animation is running, Cinnamon never calls completed_switch_workspace(). Muffin's switch_workspace_in_progress stays at 1, and while it is non-zero muffin skips all plugin effects and meta_window_actor_hide() defers hiding until the switch completes. From then on every minimized window stays painted on screen and only loses focus, until the next workspace switch (which emits kill-switch-workspace) or a Cinnamon restart.

_switchWorkspace() removes actors from to_windows / from_windows only in the onComplete callback of ease(), and _makeEaseCallback() only calls onComplete when the transition finished. A window actor destroyed during the slide gets isFinished = false, so it stays in from_windows forever.

Steps to reproduce

With animations enabled:

zenity --info --title=victim --text=victim & sleep 1
V=$(xdotool search --name '^victim$')
wmctrl -s 1; wmctrl -ic $V     # close the window while the slide is running
zenity --info --title=probe --text=probe & sleep 1
xdotool windowminimize $(xdotool search --name '^probe$')

The probe window stays on screen after it is minimized (3/3 attempts on Cinnamon 6.6.9 / Muffin 6.6.3, X11). Minimizing or moving the window during the slide doesn't trigger it, closing it does.

Fix

  • Use onStopped instead of onComplete for the two slide ease() calls, so an interrupted transition also removes the actor from the sets. onStopped(false) is called when an easing actor is destroyed. Running cleanup_window_effect() on that actor is harmless: the destroy signal has already been emitted at that point and the calls don't error.
  • Remove actors from the sets before cleanup, and clear the sets in the kill-switch-workspace handler before cleaning up. remove_all_transitions() now re-enters finish_switch_workspace() through onStopped, and that becomes a no-op.
  • Route every exit through a complete() helper that disconnects the kill handler and calls completed_switch_workspace() exactly once.

Testing

I tested this by replacing WindowManager.prototype._switchWorkspace in a running Cinnamon 6.6.9 session (the function body is identical on master, apart from the new gesture block at the top):

  • The repro above: minimize keeps working after closing a window during the slide (3/3, with 0, 50 and 100 ms delays).
  • Minimizing a window during the slide: still fine.
  • Rapid switching where a new switch interrupts the previous one (kill-switch-workspace path): window positions and visibility are unchanged afterwards, minimize works, and there are no Error in workspace_switch accounting! warnings or JS errors.

@mtwebster
mtwebster merged commit e34ada5 into linuxmint:master Nov 20, 2026
5 of 6 checks passed
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.

Minimized windows stay visible: muffin stops emitting minimize / hiding the window actor until Cinnamon is restarted

2 participants