From ea9a01f2e39ccd3e57a87429b7a88744dd6215ad Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 21 Jun 2022 08:49:59 -0500 Subject: [PATCH] xwm: Prepare send_configurenotify for non-fullscreen use Currently weston_wm_window_send_configurenotify is only called for fullscreen clients, and it is written to be correct only in that case. Fix it up to handle other cases properly so we can use it for them in a later commit. Synthetic Configure Notify events are relative to the root window, so this means adding our window co-ordinate when necessary. Signed-off-by: Derek Foreman --- xwayland/window-manager.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 0833b617..a0a61912 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -675,15 +675,22 @@ weston_wm_window_send_configure_notify(struct weston_wm_window *window) xcb_configure_notify_event_t configure_notify; struct weston_wm *wm = window->wm; int x, y; + int32_t dx = 0, dy = 0; + const struct weston_desktop_xwayland_interface *xwayland_api = + wm->server->compositor->xwayland_interface; weston_wm_window_get_child_position(window, &x, &y); + /* Synthetic ConfigureNotify events must be relative to the root + * window, so get our offset if we're mapped. */ + if (window->shsurf) + xwayland_api->get_position(window->shsurf, &dx, &dy); configure_notify.response_type = XCB_CONFIGURE_NOTIFY; configure_notify.pad0 = 0; configure_notify.event = window->id; configure_notify.window = window->id; configure_notify.above_sibling = XCB_WINDOW_NONE; - configure_notify.x = x; - configure_notify.y = y; + configure_notify.x = x + dx; + configure_notify.y = y + dy; configure_notify.width = window->width; configure_notify.height = window->height; configure_notify.border_width = 0;