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 <ofourdan@redhat.com>
Reviewed-by: Kenny Levinsen <kl@kl.wtf>
This commit is contained in:
Olivier Fourdan 2023-11-09 10:40:53 +01:00
parent 06eb7271a9
commit a797776ff2

View File

@ -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