]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: prevent overriding maximized/fullscreen/tiled geometry
authorJohn Lindgren <john@jlindgren.net>
Fri, 17 Feb 2023 19:08:27 +0000 (14:08 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 27 Nov 2023 21:58:59 +0000 (21:58 +0000)
Fixes an issue where some XWayland views (example: xfce4-terminal)
do not end up with exactly the correct geometry when tiled.

src/xwayland.c

index 0753f1dedcb413efba3bfa52885312d0b91d33fa..e92ad87b4a9234b8b9f69337c51c871b13418a2d 100644 (file)
@@ -319,12 +319,21 @@ handle_request_configure(struct wl_listener *listener, void *data)
        struct view *view = &xwayland_view->base;
        struct wlr_xwayland_surface_configure_event *event = data;
 
-       int width = event->width;
-       int height = event->height;
-       view_adjust_size(view, &width, &height);
-
-       xwayland_view_configure(view,
-               (struct wlr_box){event->x, event->y, width, height});
+       if (view_is_floating(view)) {
+               /* Honor client configure requests for floating views */
+               struct wlr_box box = {.x = event->x, .y = event->y,
+                       .width = event->width, .height = event->height};
+               view_adjust_size(view, &box.width, &box.height);
+               xwayland_view_configure(view, box);
+       } else {
+               /*
+                * Do not allow clients to request geometry other than
+                * what we computed for maximized/fullscreen/tiled
+                * views. Ignore the client request and send back a
+                * ConfigureNotify event with the computed geometry.
+                */
+               xwayland_view_configure(view, view->pending);
+       }
 }
 
 static void