From 5ef4ad0af2104f4e6f7ba26bb587df5972b15032 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 31 May 2022 14:49:26 +0200 Subject: [PATCH] xwayland: update the Xwayland screen size first When updating the overall screen size, Xwayland would first walk the window tree then update both the xwl_screen and screen size. As a result, if any ResizeWindow() handler tries to use the xwl_screen size, it would get the old (wrong) size instead of the new one. Make sure to update the xwl_screen size first, prior to traverse the window tree. This is preparation work for Xwayland fullscreen mode. Signed-off-by: Olivier Fourdan Reviewed-by: Adam Jackson --- hw/xwayland/xwayland-output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 39434b5ec..818df6d08 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -184,14 +184,15 @@ update_backing_pixmaps(struct xwl_screen *xwl_screen, int width, int height) static void update_screen_size(struct xwl_screen *xwl_screen, int width, int height) { + xwl_screen->width = width; + xwl_screen->height = height; + if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); if (!xwl_screen->rootless && xwl_screen->screen->root) update_backing_pixmaps (xwl_screen, width, height); - xwl_screen->width = width; - xwl_screen->height = height; xwl_screen->screen->width = width; xwl_screen->screen->height = height; xwl_screen->screen->mmWidth = (width * 25.4) / monitorResolution;