From 539859bde0dec8267cb7864f048eb25174a28c63 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 6 May 2024 11:37:36 +0200 Subject: [PATCH] xwayland: Restore the ResizeWindow handler For now it just chains to ResizeWindow hook. This is preparation work for the next commit, no functional change. Signed-off-by: Olivier Fourdan Part-of: --- hw/xwayland/xwayland-screen.c | 3 +++ hw/xwayland/xwayland-screen.h | 1 + hw/xwayland/xwayland-window.c | 17 +++++++++++++++++ hw/xwayland/xwayland-window.h | 4 ++++ 4 files changed, 25 insertions(+) diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index e1c64b9aa..287fe8b06 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -1145,6 +1145,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->ConfigNotify = pScreen->ConfigNotify; pScreen->ConfigNotify = xwl_config_notify; + xwl_screen->ResizeWindow = pScreen->ResizeWindow; + pScreen->ResizeWindow = xwl_resize_window; + 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 e05497a66..0800fb392 100644 --- a/hw/xwayland/xwayland-screen.h +++ b/hw/xwayland/xwayland-screen.h @@ -78,6 +78,7 @@ struct xwl_screen { XYToWindowProcPtr XYToWindow; SetWindowPixmapProcPtr SetWindowPixmap; ChangeWindowAttributesProcPtr ChangeWindowAttributes; + ResizeWindowProcPtr ResizeWindow; MoveWindowProcPtr MoveWindow; SourceValidateProcPtr SourceValidate; SetShapeProcPtr SetShape; diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index b8a2ddb18..a254eaedd 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -1830,6 +1830,23 @@ xwl_config_notify(WindowPtr window, return ret; } +void +xwl_resize_window(WindowPtr window, + int x, int y, + unsigned int width, unsigned int height, + WindowPtr sib) +{ + ScreenPtr screen = window->drawable.pScreen; + struct xwl_screen *xwl_screen; + + xwl_screen = xwl_screen_get(screen); + + screen->ResizeWindow = xwl_screen->ResizeWindow; + screen->ResizeWindow(window, x, y, width, height, sib); + xwl_screen->ResizeWindow = screen->ResizeWindow; + screen->ResizeWindow = xwl_resize_window; +} + void xwl_move_window(WindowPtr window, int x, int y, diff --git a/hw/xwayland/xwayland-window.h b/hw/xwayland/xwayland-window.h index f73d05684..30d49c699 100644 --- a/hw/xwayland/xwayland-window.h +++ b/hw/xwayland/xwayland-window.h @@ -135,6 +135,10 @@ int xwl_config_notify(WindowPtr window, int x, int y, int width, int height, int bw, WindowPtr sib); +void xwl_resize_window(WindowPtr window, + int x, int y, + unsigned int width, unsigned int height, + WindowPtr sib); void xwl_move_window(WindowPtr window, int x, int y, WindowPtr next_sib,