xwayland: Use ConfigNotify screen hook instead of ResizeWindow

Preparation for later commits, no functional change intended.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1300>
This commit is contained in:
Michel Dänzer 2024-02-15 18:08:16 +01:00 committed by Marge Bot
parent 3a0fc2684a
commit fa7b1c20c4
4 changed files with 21 additions and 15 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -129,9 +129,9 @@ 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 xwl_config_notify(WindowPtr window,
int x, int y,
unsigned int width, unsigned int height,
int width, int height, int bw,
WindowPtr sib);
void xwl_move_window(WindowPtr window,
int x, int y,