gpui: Add runtime window visibility to snapshots - #3003
Open
domenkozar wants to merge 2 commits into
Open
Conversation
domenkozar
marked this pull request as ready for review
September 7, 2026 22:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tray applications need to hide a window and restore the same view without closing it or rebuilding its state. This adds
Window::set_visible(bool)to the GPUI snapshots, with implementations for macOS, Windows, X11, Wayland, web, and the headless/test platforms. Callers can explicitly activate the restored window when it should receive focus.Since the platform sources live in Zed, this proposes carrying the implementation as a patch in the snapshot publisher. Staging checks every hunk before applying it, stops on upstream drift, marks modified source files, and records the patch in the snapshot metadata. The publishing verification also runs a regression test for initial visibility, repeated hide/show, and independence between windows. The patch README documents its origin, refresh/removal procedure, and the need for
--forcewhen releasing a patch-only change.On Wayland, hiding unmaps the surface and suspends frame retries; restoring reapplies toplevel properties and waits for configuration before presenting. This includes a fix to the original implementation for hiding from inside a frame callback, which could otherwise keep scheduling retries.
Validation passed against both Zed
69164008341295ad481bb11c0334a712ca8c23e3(gpui-pre 0.3.4) anddb10a8dd733e64682638b98232c190e8babecd5a(current main when tested):cargo test -p gpui-pre --features test-support --test window_visibilityin the staged workspace.cargo check -p gpui-pre-platform --features x11,waylandin the staged workspace.Native window-manager behavior on each desktop platform, the web implementation, and the full publish dry run still need validation. No crates were published.