[PATCH xwayland 3/3] xwayland: fix pointer enter/leave

Tiago Vignatti tiago.vignatti at intel.com
Mon May 7 05:04:59 PDT 2012


Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 hw/xfree86/xwayland/xwayland-input.c |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
index 79def3b..7cc7a1f 100644
--- a/hw/xfree86/xwayland/xwayland-input.c
+++ b/hw/xfree86/xwayland/xwayland-input.c
@@ -353,17 +353,10 @@ input_device_handle_pointer_enter(void *data,
     xwl_input_device->xwl_screen->serial = serial;
     xwl_input_device->pointer_enter_serial = serial;
 
-    if (surface)
-	xwl_input_device->focus_window = wl_surface_get_user_data(surface);
-    else
-	xwl_input_device->focus_window = NULL;
+    xwl_input_device->focus_window = wl_surface_get_user_data(surface);
 
-    if (xwl_input_device->focus_window)
-	SetDeviceRedirectWindow(xwl_input_device->pointer,
-				xwl_input_device->focus_window->window);
-    else
-	SetDeviceRedirectWindow(xwl_input_device->pointer,
-				PointerRootWin);
+    SetDeviceRedirectWindow(xwl_input_device->pointer,
+                            xwl_input_device->focus_window->window);
 }
 
 static void
@@ -414,6 +407,9 @@ input_device_handle_pointer_leave(void *data,
     struct xwl_input_device *xwl_input_device = data;
 
     xwl_input_device->xwl_screen->serial = serial;
+
+    xwl_input_device->focus_window = NULL;
+    SetDeviceRedirectWindow(xwl_input_device->pointer, PointerRootWin);
 }
 
 static void
-- 
1.7.9.5



More information about the wayland-devel mailing list