[PATCH] xwm: Fix wrong input offset for certain clients

Scott Moreau oreaus at gmail.com
Sun Mar 18 18:22:17 UTC 2018


Some windows might get a create_notify event without the
override redirect flag set and then get a confiure_notify
event before map_request is received. This means that when
weston_wm_window_get_child_position is called in response
to configure_notify, the wrong offsets are computed resulting
in wrong input offsets for some clients like steam.
---
 xwayland/window-manager.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index c307e19..2307f1a 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -711,10 +711,12 @@ weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *ev
 	if (configure_request->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
 		window->height = configure_request->height;
 
-	if (window->frame)
+	if (window->frame) {
 		frame_resize_inside(window->frame, window->width, window->height);
+		weston_wm_window_get_child_position(window, &x, &y);
+	} else
+		x = y = 0;
 
-	weston_wm_window_get_child_position(window, &x, &y);
 	values[i++] = x;
 	values[i++] = y;
 	values[i++] = window->width;
-- 
2.7.4



More information about the wayland-devel mailing list