voelin-gpui: a window left maximized is maximized again, and stays remembered so
GPUI asks for a maximized window before it maps it, and an X11 window manager manages a window only from its map (openbox loses the request), so a window the last run left maximized opened at its restored size, and the next close overwrote maximized:true with false. MainView now zooms the window at its first frame when it was opened to be maximized and is not by then (zoom toggles on X11, so a maximized one is left alone). The root state keeps what such a window reports as not the user's until the window has been seen maximized, so a run that ends first, or one whose window manager never maximizes, leaves maximized:true as it found it; a maximized window is kept with the size it returns to (X11 reports the screen's). GPUI's test platform has no zoom, so the tests count the request and play the window manager's answer; the X11 behaviour was seen under openbox on a private Xvfb and is recorded in docs/ui.md. CHANGELOG notes it. Also wraps the module comment of app.rs that the previous commit left long. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c0f385f2f
commit
302524a144
5 files changed
+257
-13
No files matched your search
+27
-2
@@ -1230,8 +1230,33 @@ it at the next tick and at close, and the next run opens there: the size always,
|
||||
the position when a screen still shows its corner and the window manager lets a
|
||||
window choose (GPUI asks X11 for the place, and openbox, like most window
|
||||
managers, places new windows itself; Wayland tells no position at all, so none
|
||||
is kept there), maximized if it was. A development switch that sets the size or
|
||||
the sample data leaves it alone.
|
||||
is kept there), maximized if it was. **Maximized** is asked for twice: GPUI
|
||||
asks when it creates the window (`WindowBounds::Maximized`: Wayland and the
|
||||
other platforms honour that), and the window asks again when its first frame is
|
||||
drawn if it is not maximized by then (`MainView`: `Window::zoom_window`, which
|
||||
toggles on X11, hence the check), because an X11 window manager manages a window
|
||||
only from its map, so the early request is lost (openbox: the window opened at
|
||||
its restored size). Until the window has been seen maximized, what it reports
|
||||
is the place it opened with and is not kept, so a run that ends before the
|
||||
window manager answers, or one whose window manager never maximizes (a tiling
|
||||
one), leaves `maximized: true` as it found it; once it has been seen maximized,
|
||||
what the window reports is the user's (restoring it is kept). A maximized
|
||||
window is kept with the size it returns to (X11 reports the screen's; Wayland
|
||||
the size it returns to). The `maximized` request itself needs a real window:
|
||||
GPUI's test platform has no zoom, so the tests count the request and report the
|
||||
window manager's answer themselves; it was seen at run time under openbox
|
||||
(below). A development switch that sets the size or the sample data leaves the
|
||||
setting alone.
|
||||
|
||||
Seen at run time (the debug build of the commit that made it, Xvfb `:143` of
|
||||
3840 by 2160 with openbox and Mesa's lavapipe, a state directory under the
|
||||
checkout's `.scratch/`, no contact with the desktop's session): a first run
|
||||
opened at 1280 by 800, openbox's `A-F10` (`ToggleMaximize`, bound in the run's
|
||||
private `rc.xml`) maximized it (`_NET_WM_STATE_MAXIMIZED_VERT` and `_HORZ`, 3840
|
||||
by 2141 below the title bar), Alt+F4 closed it with exit status 0, and `ui.window`
|
||||
held `{"width":1280,"height":800,"x":1280,"y":687,"maximized":true}`: the size
|
||||
it returns to, not the screen's. A second run came up maximized with no one
|
||||
touching it, and closed the same way leaving the same value.
|
||||
|
||||
**What the shell costs idle** (`VOELIN_METER=1`, release build of the shell
|
||||
commit `6b4341a`, the later ones change nothing that runs while idle; 1440 by
|
||||
|
||||
Reference in new issue
Block a user