]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xdg: Set initial pending dimensions for the view at map
authorJohn Lindgren <john@jlindgren.net>
Thu, 9 Feb 2023 06:21:52 +0000 (01:21 -0500)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Thu, 9 Feb 2023 17:26:44 +0000 (18:26 +0100)
We would like to use the pending dimensions in view positioning
logic, so make sure they are set early on.

src/xdg.c

index 35b58a2b7822897b37c6f94931234f75d6f2da03..b320e0497e39ab3fa48185d8512c113cfe5bbaa1 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -348,6 +348,14 @@ xdg_toplevel_view_map(struct view *view)
                foreign_toplevel_handle_create(view);
                view_set_decorations(view, has_ssd(view));
 
+               /*
+                * Set initial "pending" dimensions (may be modified by
+                * view_set_fullscreen/view_maximize() below). "Current"
+                * dimensions remain zero until handle_commit().
+                */
+               view->pending.width = xdg_surface->current.geometry.width;
+               view->pending.height = xdg_surface->current.geometry.height;
+
                position_xdg_toplevel_view(view);
                if (!view->fullscreen && requested->fullscreen) {
                        view_set_fullscreen(view, true,