[PATCH v2 xserver] xwayland: fix EnterNotify position

Tiago Vignatti tiago.vignatti at intel.com
Mon Jul 16 07:12:24 PDT 2012


enter handler wasn't updating sprite coordinates based on the Wayland event
just sent, failing when forwarding the correct EnterNotify to the X client.

There was a doubt regarding whether ProcessInputEvents should be called just
after SetCursorPosition or not in order to dequeue the event. When the cursor
is in motion it obviously will trigger PIE, so to verify it without moving I
used the switcher binding (mod + tab), so the cursor would enter another
(frame) window that was unmapped, change to the right cursor and PIE would
have to be triggered right after. In fact that was the case and I simply
assumed a direct call to PIE wasn't really needed there.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
v2: use SetCursorPosition instead touch the pointers values directly.

 hw/xfree86/xwayland/xwayland-input.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
index a06cf20..b129fae 100644
--- a/hw/xfree86/xwayland/xwayland-input.c
+++ b/hw/xfree86/xwayland/xwayland-input.c
@@ -268,12 +268,17 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
     struct xwl_seat *xwl_seat = data;
     DeviceIntPtr dev = xwl_seat->pointer;
     int i;
+    int sx = wl_fixed_to_int(sx_w);
+    int sy = wl_fixed_to_int(sy_w);
+    ScreenPtr pScreen = xwl_seat->xwl_screen->screen;
 
     xwl_seat->xwl_screen->serial = serial;
     xwl_seat->pointer_enter_serial = serial;
 
     xwl_seat->focus_window = wl_surface_get_user_data(surface);
 
+    (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
+
     SetDeviceRedirectWindow(xwl_seat->pointer, xwl_seat->focus_window->window);
 
     /* Ideally, X clients shouldn't see these button releases.  When
-- 
1.7.9.5



More information about the wayland-devel mailing list