From 53b6d4db7edfe5109681a4c1554e83df6d98be3e Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Fri, 11 Aug 2023 11:16:04 +0200 Subject: [PATCH] xwayland: Apply root toplevel configure dimensions While we now have support for resize of the root window through libdecor, we still ignore toplevel configure dimensions when libdecor is not in use. This ignores user intent in many Wayland servers, and some xdg_toplevel states when active have strong requirements for adherence to configure dimensions. Resize in response to xdg_toplevel configure dimensions like we do for libdecor configure events. Signed-off-by: Kenny Levinsen --- hw/xwayland/xwayland-window.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index c50b5c179..a4f02a058 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -765,6 +765,14 @@ xdg_toplevel_handle_configure(void *data, int32_t height, struct wl_array *states) { + struct xwl_window *xwl_window = data; + + /* Maintain our current size if no dimensions are requested */ + if (width == 0 && height == 0) + return; + + /* This will be committed by the xdg_surface.configure handler */ + xwl_window_maybe_resize(xwl_window, width, height); } static void @@ -823,7 +831,7 @@ xwl_create_root_surface(struct xwl_window *xwl_window) xdg_toplevel_add_listener(xwl_window->xdg_toplevel, &xdg_toplevel_listener, - NULL); + xwl_window); } xwl_window_rootful_update_title(xwl_window);