[PATCH xserver] xwayland: send synthetic buttons up events when grabbing

Tiago Vignatti tiago.vignatti at intel.com
Fri Jun 8 10:10:49 PDT 2012


Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---

I haven't thought much whether xwm now will really need to grab the pointer
during move/resize.

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

diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
index 517ad30..079ba4f 100644
--- a/hw/xfree86/xwayland/xwayland-input.c
+++ b/hw/xfree86/xwayland/xwayland-input.c
@@ -275,10 +275,18 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
 
     xwl_seat->xwl_screen->serial = serial;
     xwl_seat->pointer_enter_serial = serial;
+    DeviceIntPtr dev = xwl_seat->pointer;
+    int i;
 
     xwl_seat->focus_window = wl_surface_get_user_data(surface);
 
     SetDeviceRedirectWindow(xwl_seat->pointer, xwl_seat->focus_window->window);
+
+    /* grab swallows all events until it's over, so we need to send synthetic
+     * release events on this case */
+    for (i = 0; i < dev->button->numButtons; i++)
+	if (BitIsOn(dev->button->down, i))
+		xf86PostButtonEvent(dev, TRUE, i, 0, 0, 0);
 }
 
 static void
-- 
1.7.9.5



More information about the wayland-devel mailing list