]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xdg: fix error when launching windowed Chromium
authortokyo4j <hrak1529@gmail.com>
Sun, 21 Jul 2024 08:09:17 +0000 (17:09 +0900)
committerJohn Lindgren <john@jlindgren.net>
Sun, 11 Aug 2024 20:48:40 +0000 (16:48 -0400)
Chromium sends 2 commits before the commit with a buffer attached. We
were just checking `wlr_box_empty(&view->pending)` to handle the cases
where an initially maximized/fullscreen client is windowed, but that
check was also returning true on the 2nd commit from Chromium, resulting
in an error message: "view has empty geometry, not centering".

src/xdg.c

index eb1061412ef8aa24da429fb84c5b93d38d54768c..b75f864f8bb29b3da3726e372fe6dc950e1ab00e 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -149,7 +149,7 @@ handle_commit(struct wl_listener *listener, void *data)
         * the pending x/y is also unset and we still need to position
         * the window.
         */
-       if (wlr_box_empty(&view->pending)) {
+       if (wlr_box_empty(&view->pending) && !wlr_box_empty(&size)) {
                view->pending.width = size.width;
                view->pending.height = size.height;
                do_late_positioning(view);