macos: Stop using _gdk_device_query_state

Directly use the backend implementation.
This commit is contained in:
Matthias Clasen 2020-08-26 15:33:37 -04:00
parent 9e06e830b7
commit b2c92392fc
4 changed files with 42 additions and 4 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
*
* 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__ */

View File

@ -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,

View File

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

View File

@ -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,