From c180eca8ef71e42a9bea23ae276c24d97caf4577 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 26 Jul 2023 09:34:18 +0200 Subject: [PATCH] xwayland: Add configuration to libdecor update size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow passing an optional libdecor configuration pointer to xwl_window_update_libdecor_size() so that we can reuse it from more than one place and avoid duplicating that code. No functional change. Signed-off-by: Olivier Fourdan Reviewed-by: Michel Dänzer --- hw/xwayland/xwayland-window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index 0951e47cd..985b0f14a 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -605,13 +605,15 @@ xwl_window_rootful_set_app_id(struct xwl_window *xwl_window) #ifdef XWL_HAS_LIBDECOR static void -xwl_window_update_libdecor_size(struct xwl_window *xwl_window, int width, int height) +xwl_window_update_libdecor_size(struct xwl_window *xwl_window, + struct libdecor_configuration *configuration /* nullable */, + int width, int height) { struct libdecor_state *state; if (xwl_window->libdecor_frame) { state = libdecor_state_new(width, height); - libdecor_frame_commit(xwl_window->libdecor_frame, state, NULL); + libdecor_frame_commit(xwl_window->libdecor_frame, state, configuration); libdecor_state_free(state); } } @@ -1226,7 +1228,7 @@ xwl_resize_window(WindowPtr window, xwl_window_check_resolution_change_emulation(xwl_window); #ifdef XWL_HAS_LIBDECOR if (window == screen->root) - xwl_window_update_libdecor_size(xwl_window, width, height); + xwl_window_update_libdecor_size(xwl_window, NULL, width, height); #endif } }