From c1565f3ca663aa4ba4316d7248737ab817116fbd Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 21 Feb 2015 11:53:59 -0800 Subject: [PATCH] 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 Reviewed-by: Daniel Stone --- 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 32007ded3..4a166ef65 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 28b0c995e..cd728ca33 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;