xserver: Branch 'master' - 9 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Sep 21 14:40:07 PDT 2015


 hw/xwayland/xwayland-cursor.c |    1 
 hw/xwayland/xwayland-input.c  |  262 +++++++++++++++++++++++++++++++++++-------
 hw/xwayland/xwayland.c        |    6 
 hw/xwayland/xwayland.h        |   14 ++
 4 files changed, 241 insertions(+), 42 deletions(-)

New commits:
commit b25f7d0c165c4d32c73fbdf9080012503d319ba1
Merge: db1089e 1ba4fde
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Sep 21 17:34:48 2015 -0400

    Merge commit '1ba4fde1015fc6da19dfbfdf0f77f1071416e215'
    
    This is ofourdan/xwayland, minus:
    
        xwayland: Always update the wl_pointer cursor on pointer focus
    
    which was rejected for ABI and design issues.

commit 1ba4fde1015fc6da19dfbfdf0f77f1071416e215
Author: Boyan Ding <stu_dby at 126.com>
Date:   Mon Aug 4 21:16:34 2014 +0800

    xwayland: Activate and enable device on first capability reporting
    
    Commit 2172714c changed behavior of capability handling, but it only
    solved part of the problem. If Xwayland is launched without a capability
    (e.g. no pointer device is connected when Xwayland was spinned up), and
    later that capability comes, the device added will not be automatically
    initialized. This patch initializes the device when the capability is
    reported for the first time, thus avoiding the problem.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=81819
    Signed-off-by: Boyan Ding <stu_dby at 126.com>
    Reviewed-by: Daniel Stone <daniels at collabora.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index a29ba78..010d28c 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -692,13 +692,13 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
         wl_pointer_add_listener(xwl_seat->wl_pointer,
                                 &pointer_listener, xwl_seat);
 
-        if (xwl_seat->pointer)
-            EnableDevice(xwl_seat->pointer, TRUE);
-        else {
+        if (xwl_seat->pointer == NULL) {
             xwl_seat_set_cursor(xwl_seat);
             xwl_seat->pointer =
                 add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc);
+            ActivateDevice(xwl_seat->pointer, TRUE);
         }
+        EnableDevice(xwl_seat->pointer, TRUE);
     } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) {
         wl_pointer_release(xwl_seat->wl_pointer);
         xwl_seat->wl_pointer = NULL;
@@ -712,12 +712,12 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
         wl_keyboard_add_listener(xwl_seat->wl_keyboard,
                                  &keyboard_listener, xwl_seat);
 
-        if (xwl_seat->keyboard)
-            EnableDevice(xwl_seat->keyboard, TRUE);
-        else {
+        if (xwl_seat->keyboard == NULL) {
             xwl_seat->keyboard =
                 add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc);
+            ActivateDevice(xwl_seat->keyboard, TRUE);
         }
+        EnableDevice(xwl_seat->keyboard, TRUE);
     } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) {
         wl_keyboard_release(xwl_seat->wl_keyboard);
         xwl_seat->wl_keyboard = NULL;
commit f1995de1c43733a9e586605674c4071357a58e78
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Aug 28 14:28:11 2015 +1000

    xwayland: call through to miPointerWarpCursor on warp_cursor
    
    This is (eventually) called during
    InitializeSprite() → *pScreen->SetCursorPosition → miPointerSetCursorPosition
    when a device is set to floating. We don't do anything special outselves, but
    we need to pass on to the next layer to make sure the device is initialized
    properly. Otherwise, pScreen stays NULL and eventually crashes the server when
    we try to clean up behind us.
    
    Test case: grab a device → floats it, ungrab again → crash
    
    Reported-by: Jason Gerecke <killertofu at gmail.com>
    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-cursor.c b/hw/xwayland/xwayland-cursor.c
index c137e1e..76729db 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -199,6 +199,7 @@ xwl_cross_screen(ScreenPtr pScreen, Bool entering)
 static void
 xwl_pointer_warp_cursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
+    miPointerWarpCursor(pDev, pScreen, x, y);
 }
 
 static miPointerScreenFuncRec xwl_pointer_screen_funcs = {
commit 373599ab008f0ecf8f3fb62455a5474f5ec8f499
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Aug 28 14:28:10 2015 +1000

    xwayland: fix crash on enter/leave for a grabbed slave device
    
    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 at gmail.com>
    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 143a801..a29ba78 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -231,7 +231,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
@@ -259,7 +259,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
commit f1ba8858d5baa63cde6361492e6d349ce1b38d21
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Aug 28 14:28:09 2015 +1000

    xwayland: use the device pointer we already have
    
    No functional changes.
    
    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 d26a786..143a801 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -246,7 +246,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
     valuator_mask_zero(&mask);
     for (i = 0; i < dev->button->numButtons; i++)
         if (BitIsOn(dev->button->down, i))
-            QueuePointerEvents(xwl_seat->pointer, ButtonRelease, i, 0, &mask);
+            QueuePointerEvents(dev, ButtonRelease, i, 0, &mask);
 }
 
 static void
commit 44f250a7e8eb86d3f41da5d186d839e7a14648a3
Author: Carlos Garnacho <carlosg at gnome.org>
Date:   Wed May 27 18:42:00 2015 +0200

    xwayland: Remove related touchpoints when unrealizing windows
    
    These sequences are forgotten to all purposes.
    
    Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index ef38e6a..d26a786 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -845,6 +845,20 @@ DDXRingBell(int volume, int pitch, int duration)
 }
 
 void
+xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window)
+{
+    struct xwl_touch *xwl_touch, *next_xwl_touch;
+
+    xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+                                  &xwl_seat->touches, link_touch) {
+        if (xwl_touch->window->window == window) {
+            xorg_list_del(&xwl_touch->link_touch);
+            free(xwl_touch);
+        }
+    }
+}
+
+void
 InitInput(int argc, char *argv[])
 {
     ScreenPtr pScreen = screenInfo.screens[0];
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index bc92beb..f25bc00 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -287,10 +287,10 @@ xwl_unrealize_window(WindowPtr window)
     xwl_screen = xwl_screen_get(screen);
 
     xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) {
-        if (!xwl_seat->focus_window)
-            continue;
-        if (xwl_seat->focus_window->window == window)
+        if (xwl_seat->focus_window && xwl_seat->focus_window->window == window)
             xwl_seat->focus_window = NULL;
+
+        xwl_seat_clear_touch(xwl_seat, window);
     }
 
     screen->UnrealizeWindow = xwl_screen->UnrealizeWindow;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 857650e..53ca420 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -159,6 +159,8 @@ void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
 
 void xwl_seat_destroy(struct xwl_seat *xwl_seat);
 
+void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window);
+
 Bool xwl_screen_init_output(struct xwl_screen *xwl_screen);
 
 struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen,
commit b7cd48f71d269101e28ae6855b895057378715f9
Author: Carlos Garnacho <carlosg at gnome.org>
Date:   Wed May 27 18:41:59 2015 +0200

    xwayland: Implement the wl_touch interface
    
    A DeviceIntPtr with touch valuators is also created in order to deliver
    the translated touch events. The lifetime of xwl_touch structs is tied
    to the wayland ones, finishing in either wl_touch.up() or wl_touch.cancel()
    
    Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 997b90f..ef38e6a 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -148,6 +148,61 @@ xwl_keyboard_proc(DeviceIntPtr device, int what)
     return BadMatch;
 }
 
+static int
+xwl_touch_proc(DeviceIntPtr device, int what)
+{
+#define NTOUCHPOINTS 20
+#define NBUTTONS 1
+#define NAXES 2
+    struct xwl_seat *xwl_seat = device->public.devicePrivate;
+    Atom btn_labels[NBUTTONS] = { 0 };
+    Atom axes_labels[NAXES] = { 0 };
+    BYTE map[NBUTTONS + 1] = { 0 };
+
+    switch (what) {
+    case DEVICE_INIT:
+        device->public.on = FALSE;
+
+        axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_X);
+        axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y);
+
+        if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels,
+                                           GetMotionHistorySize(), Absolute))
+            return BadValue;
+
+        if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map))
+            return BadValue;
+
+        if (!InitTouchClassDeviceStruct(device, NTOUCHPOINTS,
+                                        XIDirectTouch, NAXES))
+            return BadValue;
+
+        /* Valuators */
+        /* FIXME: devices might be mapped to a single wl_output */
+        InitValuatorAxisStruct(device, 0, axes_labels[0],
+                               0, xwl_seat->xwl_screen->width,
+                               10000, 0, 10000, Absolute);
+        InitValuatorAxisStruct(device, 1, axes_labels[1],
+                               0, xwl_seat->xwl_screen->height,
+                               10000, 0, 10000, Absolute);
+        return Success;
+
+    case DEVICE_ON:
+        device->public.on = TRUE;
+        return Success;
+
+    case DEVICE_OFF:
+    case DEVICE_CLOSE:
+        device->public.on = FALSE;
+        return Success;
+    }
+
+    return BadMatch;
+#undef NAXES
+#undef NBUTTONS
+#undef NTOUCHPOINTS
+}
+
 static void
 pointer_handle_enter(void *data, struct wl_pointer *pointer,
                      uint32_t serial, struct wl_surface *surface,
@@ -480,6 +535,129 @@ static const struct wl_keyboard_listener keyboard_listener = {
     keyboard_handle_repeat_info,
 };
 
+static struct xwl_touch *
+xwl_seat_lookup_touch(struct xwl_seat *xwl_seat, int32_t id)
+{
+    struct xwl_touch *xwl_touch, *next_xwl_touch;
+
+    xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+                                  &xwl_seat->touches, link_touch) {
+        if (xwl_touch->id == id)
+            return xwl_touch;
+    }
+
+    return NULL;
+}
+
+static void
+xwl_touch_send_event(struct xwl_touch *xwl_touch,
+                     struct xwl_seat *xwl_seat, int type)
+{
+    int32_t dx, dy;
+    ValuatorMask mask;
+
+    dx = xwl_touch->window->window->drawable.x;
+    dy = xwl_touch->window->window->drawable.y;
+
+    valuator_mask_zero(&mask);
+    valuator_mask_set(&mask, 0, dx + xwl_touch->x);
+    valuator_mask_set(&mask, 1, dy + xwl_touch->y);
+    QueueTouchEvents(xwl_seat->touch, type, xwl_touch->id, 0, &mask);
+}
+
+static void
+touch_handle_down(void *data, struct wl_touch *wl_touch,
+                  uint32_t serial, uint32_t time,
+                  struct wl_surface *surface,
+                  int32_t id, wl_fixed_t sx_w, wl_fixed_t sy_w)
+{
+    struct xwl_seat *xwl_seat = data;
+    struct xwl_touch *xwl_touch;
+
+    if (surface == NULL)
+        return;
+
+    xwl_touch = calloc(sizeof *xwl_touch, 1);
+    if (xwl_touch == NULL) {
+        ErrorF("touch_handle_down ENOMEM");
+        return;
+    }
+
+    xwl_touch->window = wl_surface_get_user_data(surface);
+    xwl_touch->id = id;
+    xwl_touch->x = wl_fixed_to_int(sx_w);
+    xwl_touch->y = wl_fixed_to_int(sy_w);
+    xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches);
+
+    xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin);
+}
+
+static void
+touch_handle_up(void *data, struct wl_touch *wl_touch,
+                uint32_t serial, uint32_t time, int32_t id)
+{
+    struct xwl_touch *xwl_touch;
+    struct xwl_seat *xwl_seat = data;
+
+    xwl_touch = xwl_seat_lookup_touch(xwl_seat, id);
+
+    if (!xwl_touch)
+        return;
+
+    xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd);
+    xorg_list_del(&xwl_touch->link_touch);
+    free(xwl_touch);
+}
+
+static void
+touch_handle_motion(void *data, struct wl_touch *wl_touch,
+                    uint32_t time, int32_t id,
+                    wl_fixed_t sx_w, wl_fixed_t sy_w)
+{
+    struct xwl_seat *xwl_seat = data;
+    struct xwl_touch *xwl_touch;
+
+    xwl_touch = xwl_seat_lookup_touch(xwl_seat, id);
+
+    if (!xwl_touch)
+        return;
+
+    xwl_touch->x = wl_fixed_to_int(sx_w);
+    xwl_touch->y = wl_fixed_to_int(sy_w);
+    xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate);
+}
+
+static void
+touch_handle_frame(void *data, struct wl_touch *wl_touch)
+{
+}
+
+static void
+touch_handle_cancel(void *data, struct wl_touch *wl_touch)
+{
+    struct xwl_seat *xwl_seat = data;
+    struct xwl_touch *xwl_touch, *next_xwl_touch;
+
+    xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+                                  &xwl_seat->touches, link_touch) {
+        /* We can't properly notify of cancellation to the X client
+         * once it thinks it has the ownership, send at least a
+         * TouchEnd event.
+         */
+        xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchEnd);
+        xorg_list_del(&xwl_touch->link_touch);
+        free(xwl_touch);
+    }
+}
+
+static const struct wl_touch_listener touch_listener = {
+    touch_handle_down,
+    touch_handle_up,
+    touch_handle_motion,
+    touch_handle_frame,
+    touch_handle_cancel
+};
+
 static DeviceIntPtr
 add_device(struct xwl_seat *xwl_seat,
            const char *driver, DeviceProc device_proc)
@@ -548,8 +726,26 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
             DisableDevice(xwl_seat->keyboard, TRUE);
     }
 
+    if (caps & WL_SEAT_CAPABILITY_TOUCH && xwl_seat->wl_touch == NULL) {
+        xwl_seat->wl_touch = wl_seat_get_touch(seat);
+        wl_touch_add_listener(xwl_seat->wl_touch,
+                              &touch_listener, xwl_seat);
+
+        if (xwl_seat->touch)
+            EnableDevice(xwl_seat->touch, TRUE);
+        else {
+            xwl_seat->touch =
+                add_device(xwl_seat, "xwayland-touch", xwl_touch_proc);
+        }
+    } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && xwl_seat->wl_touch) {
+        wl_touch_release(xwl_seat->wl_touch);
+        xwl_seat->wl_touch = NULL;
+
+        if (xwl_seat->touch)
+            DisableDevice(xwl_seat->touch, TRUE);
+    }
+
     xwl_seat->xwl_screen->expecting_event--;
-    /* FIXME: Touch ... */
 }
 
 static void
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 3c10862..857650e 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -116,10 +116,12 @@ struct xwl_touch {
 struct xwl_seat {
     DeviceIntPtr pointer;
     DeviceIntPtr keyboard;
+    DeviceIntPtr touch;
     struct xwl_screen *xwl_screen;
     struct wl_seat *seat;
     struct wl_pointer *wl_pointer;
     struct wl_keyboard *wl_keyboard;
+    struct wl_touch *wl_touch;
     struct wl_array keys;
     struct xwl_window *focus_window;
     uint32_t id;
commit d96eccc057094be31c1ee4e3b3246675934cb19d
Author: Carlos Garnacho <carlosg at gnome.org>
Date:   Wed May 27 18:41:58 2015 +0200

    xwayland: Add xwl_touch struct
    
    This struct holds information about each individual, ongoing touchpoint.
    A list of these is held by the xwl_seat.
    
    Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 4a166ef..997b90f 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -586,11 +586,21 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version
     xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor);
     wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat);
     wl_array_init(&xwl_seat->keys);
+
+    xorg_list_init(&xwl_seat->touches);
 }
 
 void
 xwl_seat_destroy(struct xwl_seat *xwl_seat)
 {
+    struct xwl_touch *xwl_touch, *next_xwl_touch;
+
+    xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch,
+                                  &xwl_seat->touches, link_touch) {
+        xorg_list_del(&xwl_touch->link_touch);
+        free(xwl_touch);
+    }
+
     wl_seat_destroy(xwl_seat->seat);
     wl_surface_destroy(xwl_seat->cursor);
     if (xwl_seat->cursor_frame_cb)
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index cd728ca..3c10862 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -106,6 +106,13 @@ struct xwl_window {
 
 #define MODIFIER_META 0x01
 
+struct xwl_touch {
+    struct xwl_window *window;
+    int32_t id;
+    int x, y;
+    struct xorg_list link_touch;
+};
+
 struct xwl_seat {
     DeviceIntPtr pointer;
     DeviceIntPtr keyboard;
@@ -123,6 +130,8 @@ struct xwl_seat {
     struct wl_callback *cursor_frame_cb;
     Bool cursor_needs_update;
 
+    struct xorg_list touches;
+
     size_t keymap_size;
     char *keymap;
     struct wl_surface *keyboard_focus;
commit c1565f3ca663aa4ba4316d7248737ab817116fbd
Author: Jasper St. Pierre <jstpierre at mecheye.net>
Date:   Sat Feb 21 11:53:59 2015 -0800

    xwayland-input: Remove our XYToWindow handler
    
    This was built as a hack for simple Wayland compositors like Weston
    which were lazy and didn't want to configure windows server-side when
    moved.
    
    Since comboboxes and menus are separate toplevel O-R windows, this hack
    breaks input as it needs to be traced normally, not simply sent to the
    focused window.
    
    X11 toolkits really do need their windows to be configured correctly
    for their O-R windows comboboxes or menus other things, so let's fix
    the lazy compositors and remove this.
    
    I have tested this patch with both Weston and Mutter and neither of
    them require any changes, and it fixes comboboxes and menus.
    
    If somebody then wants to revert 73698d4, that's fine by me, so we
    reduce the amount of API that DDXen have.
    
    Signed-off-by: Jasper St. Pierre <jstpierre at mecheye.net>
    Reviewed-by: Daniel Stone <daniels at collabora.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 32007de..4a166ef 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -638,37 +638,6 @@ DDXRingBell(int volume, int pitch, int duration)
 {
 }
 
-static WindowPtr
-xwl_xy_to_window(ScreenPtr screen, SpritePtr sprite, int x, int y)
-{
-    struct xwl_seat *xwl_seat = NULL;
-    DeviceIntPtr device;
-
-    for (device = inputInfo.devices; device; device = device->next) {
-        if (device->deviceProc == xwl_pointer_proc &&
-            device->spriteInfo->sprite == sprite) {
-            xwl_seat = device->public.devicePrivate;
-            break;
-        }
-    }
-
-    if (xwl_seat == NULL) {
-        /* XTEST device */
-        sprite->spriteTraceGood = 1;
-        return sprite->spriteTrace[0];
-    }
-
-    if (xwl_seat->focus_window) {
-        sprite->spriteTraceGood = 2;
-        sprite->spriteTrace[1] = xwl_seat->focus_window->window;
-        return miSpriteTrace(sprite, x, y);
-    }
-    else {
-        sprite->spriteTraceGood = 1;
-        return sprite->spriteTrace[0];
-    }
-}
-
 void
 InitInput(int argc, char *argv[])
 {
@@ -681,9 +650,6 @@ InitInput(int argc, char *argv[])
     wl_registry_add_listener(xwl_screen->input_registry, &input_listener,
                              xwl_screen);
 
-    xwl_screen->XYToWindow = pScreen->XYToWindow;
-    pScreen->XYToWindow = xwl_xy_to_window;
-
     xwl_screen->expecting_event = 0;
     wl_display_roundtrip(xwl_screen->display);
     while (xwl_screen->expecting_event)
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 28b0c99..cd728ca 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -62,7 +62,6 @@ struct xwl_screen {
     DestroyWindowProcPtr DestroyWindow;
     RealizeWindowProcPtr RealizeWindow;
     UnrealizeWindowProcPtr UnrealizeWindow;
-    XYToWindowProcPtr XYToWindow;
 
     struct xorg_list output_list;
     struct xorg_list seat_list;


More information about the xorg-commit mailing list