Skip to content

appswitcher: Destroy the background actor when closing the 3D switchers - #14162

Open
MNCloudwerksTechnology wants to merge 1 commit into
linuxmint:masterfrom
MNCloudwerksTechnology:appswitcher3d-destroy-background
Open

MNCloudwerksTechnology wants to merge 1 commit into
linuxmint:masterfrom
MNCloudwerksTechnology:appswitcher3d-destroy-background

Conversation

@MNCloudwerksTechnology

Copy link
Copy Markdown

Problem

AppSwitcher3D (used by the Coverflow and Timeline Alt-Tab switchers) creates a new full-screen background in _init() on every Alt-Tab, but _destroyActors() only removes it from Main.switcherGroup and never destroys it. Every invocation leaks its background (one per monitor).

On X11 the leaked backgrounds stay registered with muffin, so every later wallpaper change runs the background transition and meta_x11_background_set_layer() (each with an X error trap push/pop) for all of them on the compositor thread. Screen updates stall while this runs, and the stall grows with the number of Alt-Tabs since Cinnamon started.

Observed impact

Cinnamon 6.6.9 / muffin 6.6.3, X11, two monitors (7680x1440), Coverflow Alt-Tab:

  • After ~7 days of uptime, a single wallpaper change caused 12,431 meta_x11_background_set_layer calls (uprobe count) and froze screen updates for 1.2–1.5 s.
  • With a wallpaper rotator that re-sets the background every minute (Variety with its clock overlay), this was a ~1 s freeze every minute.
  • With the background destroyed, each Alt-Tab's background is disposed right after the switcher closes, and the same wallpaper change makes 8 set_layer calls with no measurable stall.

(6.6.x has the same bug; there the background lives in global.overlay_group.)

Fix

Destroy and drop the background in _destroyActors(), the same way expo.js and overview.js already tear down theirs.

To reproduce

  1. X11 session, Alt-Tab switcher style set to Coverflow (3D) or Timeline (3D).
  2. Alt-Tab a few hundred times.
  3. Change the desktop background. Screen updates stall, and the stall gets longer the more Alt-Tabs happened since Cinnamon started.

🤖 Generated with Claude Code

AppSwitcher3D creates a new full-screen background in _init() on every
Alt-Tab, but _destroyActors() only removed it from Main.switcherGroup
and never destroyed it. Every Coverflow/Timeline invocation therefore
leaked its background (one per monitor).

On X11 the leaked backgrounds stay registered with muffin, so every
later wallpaper change runs the background transition and
meta_x11_background_set_layer() for all of them on the compositor
thread. After a few days of uptime this freezes screen updates for
more than a second on each wallpaper change.

Destroy and drop the background, as expo.js and overview.js already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MNCloudwerksTechnology

Copy link
Copy Markdown
Author

I rarely shut down my machine and this kept coming back every few days. So i put claude up to the task to investigate.

Fixed locally, issue didn't happen ever since.

So this is the upstream 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.

1 participant