diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2024-05-06 11:39:32 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2024-05-13 13:43:24 +0200 |
commit | 2d0dabbe102e1cb09d3c25cad504a6b7cdad143a (patch) | |
tree | 46ff2d009d3cac3db323ac6c9e0625158b51c750 /hw | |
parent | ce6c665e774fd6e3e4e6a05b97d5a97f42f5fb8e (diff) |
xwayland: Handle rootful resize in ResizeWindow
Commit fa7b1c20 ("xwayland: Use ConfigNotify screen hook instead of
ResizeWindow") replaced the WindowResize hook with ConfigNotify.
However, that's breaking rootful Xwayland with libdecor because the root
window size is already set so the libdecor size is not updated, and the
root size will be reverted back as soon as the focus changes.
Reinstate the rootful size change in ResizeWindow to avoid that issue.
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1669
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1671
Fixes: fa7b1c20 - xwayland: Use ConfigNotify screen hook instead of ResizeWindow
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit 31d6f9998dde3bb6ce9db577ecd0ffe4678607f2)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1535>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xwayland/xwayland-window.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index a254eaedd..7a25e88b8 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -1814,17 +1814,6 @@ xwl_config_notify(WindowPtr window, if (size_changed && xwl_window) { if (xwl_window_get(window) || xwl_window_is_toplevel(window)) xwl_window_check_resolution_change_emulation(xwl_window); - if (window == screen->root) { -#ifdef XWL_HAS_LIBDECOR - unsigned int decor_width, decor_height; - - decor_width = width / xwl_screen->global_surface_scale; - decor_height = height / xwl_screen->global_surface_scale; - xwl_window_update_libdecor_size(xwl_window, NULL, - decor_width, decor_height); -#endif - xwl_window_check_fractional_scale_viewport(xwl_window, width, height); - } } return ret; @@ -1838,13 +1827,29 @@ xwl_resize_window(WindowPtr window, { ScreenPtr screen = window->drawable.pScreen; struct xwl_screen *xwl_screen; + struct xwl_window *xwl_window; xwl_screen = xwl_screen_get(screen); + xwl_window = xwl_window_from_window(window); screen->ResizeWindow = xwl_screen->ResizeWindow; screen->ResizeWindow(window, x, y, width, height, sib); xwl_screen->ResizeWindow = screen->ResizeWindow; screen->ResizeWindow = xwl_resize_window; + + if (xwl_window) { + if (window == screen->root) { +#ifdef XWL_HAS_LIBDECOR + unsigned int decor_width, decor_height; + + decor_width = width / xwl_screen->global_surface_scale; + decor_height = height / xwl_screen->global_surface_scale; + xwl_window_update_libdecor_size(xwl_window, NULL, + decor_width, decor_height); +#endif + xwl_window_check_fractional_scale_viewport(xwl_window, width, height); + } + } } void |