From b2c92392fc8d3ec28e6f76891c84cee466886979 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 26 Aug 2020 15:33:37 -0400 Subject: [PATCH] macos: Stop using _gdk_device_query_state Directly use the backend implementation. --- gdk/macos/gdkmacosdevice-private.h | 36 ++++++++++++++++++++++++++++++ gdk/macos/gdkmacosdevice.c | 4 ++-- gdk/macos/gdkmacosdrag.c | 3 ++- gdk/macos/gdkmacossurface.c | 3 ++- 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 gdk/macos/gdkmacosdevice-private.h diff --git a/gdk/macos/gdkmacosdevice-private.h b/gdk/macos/gdkmacosdevice-private.h new file mode 100644 index 0000000000..6daafa8135 --- /dev/null +++ b/gdk/macos/gdkmacosdevice-private.h @@ -0,0 +1,36 @@ +/* + * Copyright © 2020 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef __GDK_MACOS_DEVICE_PRIVATE_H__ +#define __GDK_MACOS_DEVICE_PRIVATE_H__ + +#include "gdkdeviceprivate.h" + +G_BEGIN_DECLS + +void gdk_macos_device_query_state (GdkDevice *device, + GdkSurface *surface, + GdkSurface **child_surface, + double *win_x, + double *win_y, + GdkModifierType *mask); + +G_END_DECLS + +#endif /* __GDK_MACOS_DEVICE_PRIVATE_H__ */ diff --git a/gdk/macos/gdkmacosdevice.c b/gdk/macos/gdkmacosdevice.c index 94ecbd4041..c590d60c50 100644 --- a/gdk/macos/gdkmacosdevice.c +++ b/gdk/macos/gdkmacosdevice.c @@ -29,7 +29,7 @@ #include "gdkmacoscursor-private.h" #include "gdkmacosdevice.h" #include "gdkmacosdisplay-private.h" -#include "gdkmacossurface-private.h" +#include "gdkmacosdevice-private.h" struct _GdkMacosDevice { @@ -126,7 +126,7 @@ gdk_macos_device_ungrab (GdkDevice *device, _gdk_display_device_grab_update (display, device, 0); } -static void +void gdk_macos_device_query_state (GdkDevice *device, GdkSurface *surface, GdkSurface **child_surface, diff --git a/gdk/macos/gdkmacosdrag.c b/gdk/macos/gdkmacosdrag.c index fcc75e6078..c89b01948f 100644 --- a/gdk/macos/gdkmacosdrag.c +++ b/gdk/macos/gdkmacosdrag.c @@ -22,6 +22,7 @@ #include "gdkdeviceprivate.h" #include "gdkintl.h" +#include "gdkmacosdevice-private.h" #include "gdkmacoscursor-private.h" #include "gdkmacosdisplay-private.h" #include "gdkmacosdrag-private.h" @@ -473,7 +474,7 @@ gdk_dnd_handle_key_event (GdkDrag *drag, * to query it here. We could use XGetModifierMapping, but * that would be overkill. */ - _gdk_device_query_state (pointer, NULL, NULL, NULL, NULL, &state); + gdk_macos_device_query_state (pointer, NULL, NULL, NULL, NULL, &state); if (dx != 0 || dy != 0) { diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c index 5f719bb923..bddbbaf038 100644 --- a/gdk/macos/gdkmacossurface.c +++ b/gdk/macos/gdkmacossurface.c @@ -32,6 +32,7 @@ #include "gdksurfaceprivate.h" #include "gdkmacosdevice.h" +#include "gdkmacosdevice-private.h" #include "gdkmacosdisplay-private.h" #include "gdkmacosdrag-private.h" #include "gdkmacosdragsurface-private.h" @@ -307,7 +308,7 @@ gdk_macos_surface_drag_begin (GdkSurface *surface, g_assert (GDK_IS_CONTENT_PROVIDER (content)); seat = gdk_device_get_seat (device); - _gdk_device_query_state (device, surface, NULL, &px, &py, NULL); + gdk_macos_device_query_state (device, surface, NULL, &px, &py, NULL); _gdk_macos_surface_get_root_coords (GDK_MACOS_SURFACE (surface), &sx, &sy); drag_surface = _gdk_macos_surface_new (GDK_MACOS_DISPLAY (surface->display), GDK_SURFACE_TEMP,