xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 17 04:28:16 UTC 2021


 hw/xwayland/xwayland-input.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 20c78f38a0b33b88bc82a2bcd54d2e6c74a4c132
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Feb 16 14:48:13 2021 +1000

    xwayland: use get_pointer_device() for enter/leave handling too
    
    In Weston, clicking the window decoration of an Xwayland client gives us a
    wl_pointer.button event immediately followed by a wl_pointer.leave event.
    The leave event does not contain any button state information, so the button
    remains logically down in the DIX.
    
    Once the pointer button is released, a wl_pointer.enter event is sent with
    the current button state (zero). This needs to trigger a ButtonRelease event
    but for that we need to ensure that the device is the same as the one we send
    ButtonPress events through.
    
    Fixes a regression introduced in a4095162ca923992a8cfae6d0f09ff9f8144762a.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 9529720a6..9b7421059 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -92,6 +92,15 @@ xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl)
     /* Nothing to do, dix handles all settings */
 }
 
+static DeviceIntPtr
+get_pointer_device(struct xwl_seat *xwl_seat)
+{
+    if (xwl_seat->relative_pointer)
+        return xwl_seat->relative_pointer;
+    else
+        return xwl_seat->pointer;
+}
+
 static Bool
 init_pointer_buttons(DeviceIntPtr device)
 {
@@ -400,7 +409,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
                      wl_fixed_t sx_w, wl_fixed_t sy_w)
 {
     struct xwl_seat *xwl_seat = data;
-    DeviceIntPtr dev = xwl_seat->pointer;
+    DeviceIntPtr dev = get_pointer_device(xwl_seat);
     DeviceIntPtr master;
     int i;
     int sx = wl_fixed_to_int(sx_w);
@@ -475,7 +484,7 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer,
                      uint32_t serial, struct wl_surface *surface)
 {
     struct xwl_seat *xwl_seat = data;
-    DeviceIntPtr dev = xwl_seat->pointer;
+    DeviceIntPtr dev = get_pointer_device(xwl_seat);
 
     xwl_seat->xwl_screen->serial = serial;
 
@@ -595,15 +604,6 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
         dispatch_pointer_motion_event(xwl_seat);
 }
 
-static DeviceIntPtr
-get_pointer_device(struct xwl_seat *xwl_seat)
-{
-    if (xwl_seat->relative_pointer)
-        return xwl_seat->relative_pointer;
-    else
-        return xwl_seat->pointer;
-}
-
 static void
 pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,
                       uint32_t time, uint32_t button, uint32_t state)


More information about the xorg-commit mailing list