]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xdg: try to keep view on the same output in timeout case
authorJohn Lindgren <john@jlindgren.net>
Wed, 6 Aug 2025 04:30:54 +0000 (00:30 -0400)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Wed, 6 Aug 2025 09:14:24 +0000 (18:14 +0900)
src/xdg.c

index d71a7d939523de2f7af772302706a14998d8fcdb..e54fdea0042eeabf73f5ceb2887e04deb25ac828 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -322,6 +322,13 @@ handle_configure_timeout(void *data)
                        wlr_log(WLR_INFO, "using fallback position");
                        view->pending.x = VIEW_FALLBACK_X;
                        view->pending.y = VIEW_FALLBACK_Y;
+                       /* At least try to keep it on the same output */
+                       if (output_is_usable(view->output)) {
+                               struct wlr_box box =
+                                       output_usable_area_in_layout_coords(view->output);
+                               view->pending.x += box.x;
+                               view->pending.y += box.y;
+                       }
                }
                view->current.x = view->pending.x;
                view->current.y = view->pending.y;