From 5cc0319ca5d997324566015194c8de4d36c95264 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 27 Apr 2022 14:34:37 +0200
Subject: [PATCH] xwayland: update_screen_size() takes a screen argument

update_screen_size() takes an xwl_output argument, mostly for historical
reasons, whereas it actually applies to a screen (as its name implies).

Reshuffle the code to take an xwl_screen instead, in preparation for
the geometry mode in Xwayland - No functional change.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
---
 hw/xwayland/xwayland-output.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 4a6a98f520..bdce261912 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -180,10 +180,8 @@ update_backing_pixmaps(struct xwl_screen *xwl_screen, int width, int height)
 }
 
 static void
-update_screen_size(struct xwl_output *xwl_output, int width, int height)
+update_screen_size(struct xwl_screen *xwl_screen, int width, int height)
 {
-    struct xwl_screen *xwl_screen = xwl_output->xwl_screen;
-
     if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL)
         SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE);
 
@@ -645,7 +643,7 @@ apply_output_change(struct xwl_output *xwl_output)
 	--xwl_screen->expecting_event;
     }
 
-    update_screen_size(xwl_output, width, height);
+    update_screen_size(xwl_screen, width, height);
 }
 
 static void
@@ -837,7 +835,7 @@ xwl_output_remove(struct xwl_output *xwl_output)
 
     xorg_list_for_each_entry(it, &xwl_screen->output_list, link)
         output_get_new_size(it, &width, &height);
-    update_screen_size(xwl_output, width, height);
+    update_screen_size(xwl_screen, width, height);
 
     RRCrtcDestroy(xwl_output->randr_crtc);
     RROutputDestroy(xwl_output->randr_output);
-- 
GitLab