Skip to content

fix: alt-tab race condition and signal handler leak#523

Open
toabctl wants to merge 2 commits into
domferr:mainfrom
toabctl:fix/alttab-disposed-race
Open

fix: alt-tab race condition and signal handler leak#523
toabctl wants to merge 2 commits into
domferr:mainfrom
toabctl:fix/alttab-disposed-race

Conversation

@toabctl
Copy link
Copy Markdown

@toabctl toabctl commented Mar 24, 2026

Fix two issues in the alt-tab override:

  1. Guard against the popup being synchronously destroyed during show() when the modifier key is released before the grab completes (GNOME#596695). This prevents hundreds of "already disposed" and clutter_actor_add_child assertion errors on every fast alt-tab.

  2. Store and disconnect unmanaged signal handlers in MetaWindowGroup so they don't leak for the lifetime of the shell process.

toabctl added 2 commits March 24, 2026 08:26
show() can synchronously destroy the popup when the modifier key
was already released before the grab completed (GNOME#596695).
This leaves _switcherList and _items disposed, causing errors on
every fast alt-tab:

  Object Gjs_ui_altTab_WindowIcon has been already disposed
  Object St.BoxLayout has been already disposed
  clutter_actor_add_child: assertion 'child->priv->parent == NULL' failed
  Can't update stage views actor unnamed [ClutterActor] is on because it needs an allocation
MetaWindowGroup connects an 'unmanaged' signal handler to each
window but never stores the signal IDs and never disconnects them.
Every alt-tab invocation leaks handlers for the lifetime of the
shell process, and the stale onAllWindowsUnmanaged callback can
fire into a destroyed switcher list.

Store signal IDs from connect(), add a destroy() method that
disconnects them, and call it from MultipleWindowsIcon's destroy
signal so cleanup happens when the popup tears down.
@toabctl
Copy link
Copy Markdown
Author

toabctl commented Mar 24, 2026

@domferr could you have a look please?

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