Repository navigation
fix(gpui-windows): keep an owned window maximized across its owner's minimize and restore - #135
Merged
Merged
Conversation
…minimize and restore When an owner window is minimized, Windows hides its owned windows and, on restore, re-shows them with WM_SHOWWINDOW(TRUE, SW_PARENTOPENING). DefWindowProc answers that with SW_SHOWNOACTIVATE, which drops a maximized window to its restore rectangle, so every owner restore silently un-maximized a detached panel or tool window. A maximized, non-iconic window now takes SW_SHOWNA, which shows it in its current state, and the message returns 0. Every other show, including an owned window the user minimized on its own, keeps the default path. Recorded in docs/MOON_PATCH_QUEUE.md as a Zed bugfix candidate.
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.
Problem
A maximized owned window (a detached panel or tool window owned by an application window) comes back un-maximized, at its restore rectangle, every time its owner is minimized and restored.
This is stock Windows behaviour, not GPUI's. When the owner is minimized, Windows hides its owned windows. On restore it re-shows them with
WM_SHOWWINDOW(TRUE, SW_PARENTOPENING), andDefWindowProcanswers that withSW_SHOWNOACTIVATE, which drops a maximized window to its restore rectangle. A bare Win32 window pair with no GPUI involved shows the same thing (showCmd3 → 1 after one owner minimize/restore), on the owner's monitor as well as on a second one.Fix
handle_window_visibility_changed(moon-gpui-windows/src/events.rs) now receiveslparam. ForSW_PARENTOPENINGon a window that is maximized and not iconic, it shows the window withSW_SHOWNA, which keeps its current state, and returns 0. The nested show sends a plainWM_SHOWWINDOW(TRUE, 0), which takes the existing path and draws.Every other show keeps the default path unchanged: normal windows, fullscreen windows (
is_maximizedexcludes them), and an owned window the user minimized on its own.The change is recorded in
docs/MOON_PATCH_QUEUE.mdunder the Zed bugfix candidates, with a re-sync note.Verification
SW_PARENTOPENING→SW_SHOWNAhandling on the bare Win32 pair keeps the owned window maximized across owner minimize/restore, on both monitors.[patch]: a maximized detached panel on a second monitor stays maximized across repeated main-window minimize/restore (checked live).cargo fmt --all -- --checkpasses.cargo clippy -p moon-gpui-windowsreports nothing in the changed function.