[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH 2/3] xwayland: fix crash on enter/leave for a grabbed slave device
From:       Peter Hutterer <peter.hutterer () who-t ! net>
Date:       2015-08-28 4:28:10
Message-ID: 1440736091-9303-2-git-send-email-peter.hutterer () who-t ! net
[Download RAW message or body]

When grabbed, the slave device is floating, i.e. the master device is NULL.
CheckMotion() isn't happy with NULL. Make sure we pass the right device in,
either the master device when the device is attached, or the device itself
when it is floating.

Reported-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 hw/xwayland/xwayland-input.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 127e8be..0f863fc 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -176,7 +176,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
     xwl_seat->focus_window = wl_surface_get_user_data(surface);
 
     (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
-    CheckMotion(NULL, GetMaster(dev, MASTER_POINTER));
+    CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT));
 
     /* Ideally, X clients shouldn't see these button releases.  When
      * the pointer leaves a window with buttons down, it means that
@@ -204,7 +204,7 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer,
     xwl_seat->xwl_screen->serial = serial;
 
     xwl_seat->focus_window = NULL;
-    CheckMotion(NULL, GetMaster(dev, MASTER_POINTER));
+    CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT));
 }
 
 static void
-- 
2.4.3

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic