From e1e3bef7f86020d2c157648966c1f65153019dd8 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 4 Dec 2023 16:10:07 +0100 Subject: [PATCH] xwayland: Use a helper function for fullscreen update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the code which may update the fullscreen state of the rootful window to a dedicated helper function. No functional change. Signed-off-by: Olivier Fourdan Acked-by: Michel Dänzer --- hw/xwayland/xwayland-output.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index cf99c6e84..c9ff5087d 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -598,10 +598,24 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, } static void -apply_output_change(struct xwl_output *xwl_output) +maybe_update_fullscreen_state(struct xwl_output *xwl_output) { struct xwl_screen *xwl_screen = xwl_output->xwl_screen; struct xwl_window *xwl_window; + + if (xwl_screen->fullscreen) { + /* The root window may not yet be created */ + if (xwl_screen->screen->root) { + xwl_window = xwl_window_get(xwl_screen->screen->root); + xwl_window_rootful_update_fullscreen(xwl_window, xwl_output); + } + } +} + +static void +apply_output_change(struct xwl_output *xwl_output) +{ + struct xwl_screen *xwl_screen = xwl_output->xwl_screen; struct xwl_output *it; int mode_width, mode_height, count; int width = 0, height = 0, has_this_output = 0; @@ -661,13 +675,7 @@ apply_output_change(struct xwl_output *xwl_output) RRTellChanged(xwl_screen->screen); /* If running rootful and fullscreen, make sure to match the new setup */ - if (xwl_screen->fullscreen) { - /* The root window may not yet be created */ - if (xwl_screen->screen->root) { - xwl_window = xwl_window_get(xwl_screen->screen->root); - xwl_window_rootful_update_fullscreen(xwl_window, xwl_output); - } - } + maybe_update_fullscreen_state(xwl_output); } static void