Skip to content

Fix GNOME 51 crash: stop calling set_unmaximize_flags() - #594

Open
Faloneagent wants to merge 1 commit into
forge-ext:mainfrom
Faloneagent:fix/gnome-51-unmaximize-crash
Open

Faloneagent wants to merge 1 commit into
forge-ext:mainfrom
Faloneagent:fix/gnome-51-unmaximize-crash

Conversation

@Faloneagent

Copy link
Copy Markdown

Fixes #592.

On GNOME 51 (Mutter 51), metaWindow.set_unmaximize_flags() crashes gnome-shell with SIGSEGV when Forge moves or tiles a window. The stack trace points at move() in window.js. Because the call sits inside try/catch, the JS fallback never runs.

This adds unmaximizeWindow(), which feature-detects the old API (get_maximized present → GNOME ≤48, behavior unchanged) and otherwise only calls unmaximize() on windows that are maximized.

Tested on Ubuntu 26.10, GNOME Shell 51.0, Wayland: with this change, opening Firefox with Forge enabled no longer crashes the shell. Not tested on GNOME 45–50, and I did not reproduce the "on window close" case from #592.

🤖 Generated with Claude Code

On GNOME 51 (Mutter 51), metaWindow.set_unmaximize_flags() crashes
gnome-shell with SIGSEGV when Forge moves or tiles a window. Since the
call sits inside try/catch, the JS fallback never runs.

Add unmaximizeWindow(), which feature-detects the old API
(get_maximized present, GNOME <=48, behavior unchanged) and otherwise
only calls unmaximize() on windows that are maximized.

Fixes forge-ext#592

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
zzantares pushed a commit to zzantares/dotless that referenced this pull request Nov 12, 2026
Forge calls set_unmaximize_flags(BOTH) unconditionally, both in move() and
from the 200 ms timer it queues on window-create. mutter 50.4 made that a
no-op unless the window really was maximized; mutter 51 rewrote the call to
always run the window-config pipeline, which reaches
meta_window_wayland_update_main_monitor. There
meta_wayland_surface_get_toplevel_window() returns NULL for a window that is
already being destroyed, and the result goes to meta_window_update_monitor
unchecked, which reads window->display at offset 0x18. A window that closes
inside those 200 ms (a Firefox Google-login popup, or Chrome per upstream)
therefore takes the whole session down: five identical SIGSEGVs here on
2026-11-12, all `segfault at 18`.

Take the upstream fix (forge-ext/forge#594, for #592) as a fetchpatch pinned
to its commit rather than as a flake input: nixpkgs pins forge at
50.1-development, the PR branches off a newer main, and swapping the source
tree would also swap the version our dconf keys and stylesheet are written
for. A pinned patch is immutable, carries its provenance in the url, and
fails loudly once nixpkgs ships a forge that no longer needs it. The PR is
unmerged and forge is unmaintained, so this stays until that changes.

Verified: the built extension keeps no set_unmaximize_flags call sites and
routes both through the new unmaximizeWindow(), which only unmaximizes an
actually maximized window; is_maximized() is API forge already uses at this
version. kosmos resolves gnomeExtensions.forge to that patched path, and
`just check-linux` builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

Bug: GNOME 51 crash - metaWindow.set_unmaximize_flags() causes Mutter SIGSEGV on window close

1 participant