From: Johan Malm Date: Mon, 4 Jul 2022 17:25:52 +0000 (+0100) Subject: xwayland.c: fix position bug X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=bfff9d02c717ad1a9b3693a843dd267774cdc7e9;p=proto%2Flabwc.git xwayland.c: fix position bug Set node position in the configure/set_geometry handlers when moving a window in response to a client request. Steps to reproduce weird positioning fixed by this patch: 1. Start leafpad 2. Open Help->About 3. Move the dialog 4. Close the dialog 5. Open it again 6. Drag it and observe a jump in position There is also an xwayland PyQt5 script in PR #428 which demonstrates jumpy position. --- diff --git a/src/xwayland-unmanaged.c b/src/xwayland-unmanaged.c index fae8d0ba..4c68223b 100644 --- a/src/xwayland-unmanaged.c +++ b/src/xwayland-unmanaged.c @@ -35,6 +35,8 @@ unmanaged_handle_set_geometry(struct wl_listener *listener, void *data) wlr_log(WLR_DEBUG, "xwayland-unmanaged surface has moved"); unmanaged->lx = xsurface->x; unmanaged->ly = xsurface->y; + wlr_scene_node_set_position(unmanaged->node, + unmanaged->lx, unmanaged->ly); } } diff --git a/src/xwayland.c b/src/xwayland.c index 37cf4c0e..9c516433 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -151,6 +151,7 @@ handle_request_configure(struct wl_listener *listener, void *data) view->pending_move_resize.width = width; view->pending_move_resize.height = height; + wlr_scene_node_set_position(&view->scene_tree->node, event->x, event->y); wlr_xwayland_surface_configure(view->xwayland_surface, event->x, event->y, width, height); }