[PATCH] xwayland-input: Remove our XYToWindow handler

Jasper St. Pierre jstpierre at mecheye.net
Sat Feb 21 11:53:59 PST 2015


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>
---
 hw/xwayland/xwayland-input.c | 34 ----------------------------------
 hw/xwayland/xwayland.h       |  1 -
 2 files changed, 35 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 5e20418..c825ef4 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -633,37 +633,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[])
 {
@@ -676,9 +645,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 bfffa71..ce359d6 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;
-- 
2.1.0



More information about the xorg-devel mailing list