diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index 135ae7b74..284189912 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -1113,8 +1113,8 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = xwl_clip_notify; - xwl_screen->ResizeWindow = pScreen->ResizeWindow; - pScreen->ResizeWindow = xwl_resize_window; + xwl_screen->ConfigNotify = pScreen->ConfigNotify; + pScreen->ConfigNotify = xwl_config_notify; xwl_screen->MoveWindow = pScreen->MoveWindow; pScreen->MoveWindow = xwl_move_window; diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h index 9653d82c9..5b30c210b 100644 --- a/hw/xwayland/xwayland-screen.h +++ b/hw/xwayland/xwayland-screen.h @@ -71,6 +71,7 @@ struct xwl_screen { ClipNotifyProcPtr ClipNotify; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; + ConfigNotifyProcPtr ConfigNotify; CreateWindowProcPtr CreateWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; @@ -79,7 +80,6 @@ struct xwl_screen { SetWindowPixmapProcPtr SetWindowPixmap; ChangeWindowAttributesProcPtr ChangeWindowAttributes; ReparentWindowProcPtr ReparentWindow; - ResizeWindowProcPtr ResizeWindow; MoveWindowProcPtr MoveWindow; int (*GrabServer) (ClientPtr client); diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index 11a6b3adc..93b689525 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -1649,25 +1649,29 @@ xwl_clip_notify(WindowPtr window, int dx, int dy) xwl_window_update_surface_window(xwl_window); } -void -xwl_resize_window(WindowPtr window, +int +xwl_config_notify(WindowPtr window, int x, int y, - unsigned int width, unsigned int height, + int width, int height, int bw, WindowPtr sib) { ScreenPtr screen = window->drawable.pScreen; struct xwl_screen *xwl_screen; struct xwl_window *xwl_window; + Bool size_changed; + int ret; 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; + size_changed = width != window->drawable.width || height != window->drawable.height; - if (xwl_window) { + screen->ConfigNotify = xwl_screen->ConfigNotify; + ret = screen->ConfigNotify(window, x, y, width, height, bw, sib); + xwl_screen->ConfigNotify = screen->ConfigNotify; + screen->ConfigNotify = xwl_config_notify; + + 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) { @@ -1682,6 +1686,8 @@ xwl_resize_window(WindowPtr window, xwl_window_check_fractional_scale_viewport(xwl_window, width, height); } } + + return ret; } void diff --git a/hw/xwayland/xwayland-window.h b/hw/xwayland/xwayland-window.h index fefb4969c..8823b03ea 100644 --- a/hw/xwayland/xwayland-window.h +++ b/hw/xwayland/xwayland-window.h @@ -129,10 +129,10 @@ Bool xwl_realize_window(WindowPtr window); Bool xwl_unrealize_window(WindowPtr window); Bool xwl_change_window_attributes(WindowPtr window, unsigned long mask); void xwl_clip_notify(WindowPtr window, int dx, int dy); -void xwl_resize_window(WindowPtr window, - int x, int y, - unsigned int width, unsigned int height, - WindowPtr sib); +int xwl_config_notify(WindowPtr window, + int x, int y, + int width, int height, int bw, + WindowPtr sib); void xwl_move_window(WindowPtr window, int x, int y, WindowPtr next_sib,