diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-08-26 16:33:49 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-08-26 17:56:41 -0400 |
commit | 0d82fcf76f6a03688941fb3bcfbe1eff57f264e6 (patch) | |
tree | 0074b833dd4624796c1b5baadc419fd514ce2b45 | |
parent | 0091de63b4e515a183d05de9b3ae78febaa85175 (diff) | |
download | gtk+-0d82fcf76f6a03688941fb3bcfbe1eff57f264e6.tar.gz |
wayland: Drop unused argument from query_state
Now that this is backend-only api, we can just
drop unused arguments.
-rw-r--r-- | gdk/wayland/gdkdevice-wayland-private.h | 1 | ||||
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 25 | ||||
-rw-r--r-- | gdk/wayland/gdksurface-wayland.c | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/gdk/wayland/gdkdevice-wayland-private.h b/gdk/wayland/gdkdevice-wayland-private.h index a1942fbe38..3dae422081 100644 --- a/gdk/wayland/gdkdevice-wayland-private.h +++ b/gdk/wayland/gdkdevice-wayland-private.h @@ -6,7 +6,6 @@ void gdk_wayland_device_query_state (GdkDevice *device, GdkSurface *surface, - GdkSurface **child_surface, double *win_x, double *win_y, GdkModifierType *mask); diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index f55a593ba4..fbbceacb65 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -521,29 +521,32 @@ device_get_modifiers (GdkDevice *device) void gdk_wayland_device_query_state (GdkDevice *device, GdkSurface *surface, - GdkSurface **child_surface, double *win_x, double *win_y, GdkModifierType *mask) { GdkWaylandPointerData *pointer; - GList *children = NULL; + double x, y; - if (surface == NULL) - children = gdk_wayland_display_get_toplevel_surfaces (gdk_device_get_display (device)); + if (mask) + *mask = device_get_modifiers (device); pointer = GDK_WAYLAND_DEVICE (device)->pointer; - if (child_surface) - /* Set child only if actually a child of the given surface, as XIQueryPointer() does */ - *child_surface = g_list_find (children, pointer->focus) ? pointer->focus : NULL; - if (mask) - *mask = device_get_modifiers (device); + if (pointer->focus == surface) + { + x = pointer->surface_x; + y = pointer->surface_y; + } + else + { + x = y = -1; + } if (win_x) - *win_x = pointer->surface_x; + *win_x = x; if (win_y) - *win_y = pointer->surface_y; + *win_y = y; } static void diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 45769984ea..0fc030f9b4 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -3173,7 +3173,7 @@ gdk_wayland_surface_get_device_state (GdkSurface *surface, if (GDK_SURFACE_DESTROYED (surface)) return FALSE; - gdk_wayland_device_query_state (device, surface, NULL, x, y, mask); + gdk_wayland_device_query_state (device, surface, x, y, mask); return *x >= 0 && *y >= 0 && *x < surface->width && *y < surface->height; } |