[PATCH] xwayland-input: Don't assume all input is children of the focused window

Jasper St. Pierre jstpierre at mecheye.net
Wed Feb 18 12:41:12 PST 2015


Some toolkits implement comboboxes or menus or other things through
O-R windows, which aren't children of the focused window. In order to
properly get input on them during grab conditions, we need to trace the
whole input tree, not just the focused window down.

Signed-off-by: Jasper St. Pierre <jstpierre at mecheye.net>
---
 hw/xwayland/xwayland-input.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 5e20418..8b96bd2 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -654,8 +654,10 @@ xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y)
     }
 
     if (xwl_seat->focus_window) {
-        sprite->spriteTraceGood = 2;
-        sprite->spriteTrace[1] = xwl_seat->focus_window->window;
+        /* convert to root coordinates */
+        x += xwl_seat->focus_window->window->drawable.x;
+        y += xwl_seat->focus_window->window->drawable.y;
+        sprite->spriteTraceGood = 1;
         return miSpriteTrace(sprite, x, y);
     }
     else {
-- 
2.1.0



More information about the xorg-devel mailing list