From 179a030bbe52bd607540c9117f3af4ff2abb701a Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Fri, 17 Feb 2023 14:08:27 -0500 Subject: [PATCH] xwayland: Prevent overriding maximized/fullscreen/tiled geometry --- src/xwayland.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/xwayland.c b/src/xwayland.c index efd5fe24..0f289a30 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -308,12 +308,24 @@ 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. + * + * FIXME: wlroots needs to synthesize ConfigureNotify: + * https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4008 + */ + xwayland_view_configure(view, view->pending); + } } static void