From a797776ff29e67b5dd60aebf3cef144a743d3cb4 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 9 Nov 2023 10:40:53 +0100 Subject: [PATCH] xwayland: Do not resize when running fullscreen When running fullscreen, if an X11 client has changed the resolution, Xwayland is using a viewport to emulate the expected resolution. When changing focus, the Wayland compositor will send a configure event with the actual surface size, not the size of the emulated XRandR resolution. As a result, changing focus while XRandR emulation (and hence the viewport) is active in Xwayland will revert the resolution to the actual output size, defeating the XRandR emulation. To avoid that issue, only change the size when not running fullscreen. Fixes: 53b6d4db7 - xwayland: Apply root toplevel configure dimensions Signed-off-by: Olivier Fourdan Reviewed-by: Kenny Levinsen --- hw/xwayland/xwayland-window.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index 92ec4995c..4978f37c7 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -789,13 +789,16 @@ xdg_toplevel_handle_configure(void *data, struct wl_array *states) { struct xwl_window *xwl_window = data; + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; /* 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); + if (!xwl_screen->fullscreen) { + /* This will be committed by the xdg_surface.configure handler */ + xwl_window_maybe_resize(xwl_window, width, height); + } } static void