1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:47:35 +00:00

WindowServer, LibGUI: Variable minimum window sizes

Minimum window size can now be customised and set at runtime via the
SetWindowMinimumSize WindowServer message and the set_minimum_size
LibGUI::Window method. The default minimum size remains at 50x50.

Some behind-the-scenes mechanics had to be added to LibGUI::Window to
ensure that the minimum size is remembered if set before the window is
shown. WindowServer sends a resize event to the client if it requests a
size on create that's smaller than it's minimum size.
This commit is contained in:
Nick Vella 2021-02-16 00:59:43 +11:00 committed by Andreas Kling
parent dea0d22ab3
commit 15c1f7a40d
7 changed files with 130 additions and 8 deletions

View file

@ -44,6 +44,7 @@ endpoint WindowServer = 2
float alpha_hit_threshold,
Gfx::IntSize base_size,
Gfx::IntSize size_increment,
Gfx::IntSize minimum_size,
Optional<Gfx::IntSize> resize_aspect_ratio,
i32 type,
[UTF8] String title,
@ -59,6 +60,9 @@ endpoint WindowServer = 2
SetWindowRect(i32 window_id, Gfx::IntRect rect) => (Gfx::IntRect rect)
GetWindowRect(i32 window_id) => (Gfx::IntRect rect)
SetWindowMinimumSize(i32 window_id, Gfx::IntSize size) => ()
GetWindowMinimumSize(i32 window_id) => (Gfx::IntSize size)
GetWindowRectInMenubar(i32 window_id) => (Gfx::IntRect rect)
StartWindowResize(i32 window_id) =|