wayland: Drop unused argument from query_state

Now that this is backend-only api, we can just
drop unused arguments.
This commit is contained in:
Matthias Clasen
2020-08-26 16:33:49 -04:00
committed by Ahmed Eldemery
parent e6d4555b34
commit 8da4a02da0
3 changed files with 16 additions and 14 deletions

View File

@@ -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);

View File

@@ -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));
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);
pointer = GDK_WAYLAND_DEVICE (device)->pointer;
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

View File

@@ -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;
}