From ab0aea900c687ef9011457aac33a65a1e9c420ca Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 24 Nov 2017 11:56:42 -0500 Subject: [PATCH] win32: Stop using gdk_display_get_device_manager We can keep the devicemanager in the backend. --- gdk/win32/gdkdevicemanager-win32.c | 8 ++------ gdk/win32/gdkdisplay-win32.c | 6 +++--- gdk/win32/gdkevents-win32.c | 10 ++++------ gdk/win32/gdkglobals-win32.c | 1 + gdk/win32/gdkprivate-win32.h | 2 ++ 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c index 3bff2107d5..a8962ec9d7 100644 --- a/gdk/win32/gdkdevicemanager-win32.c +++ b/gdk/win32/gdkdevicemanager-win32.c @@ -683,9 +683,7 @@ wintab_default_display_notify_cb (GdkDisplayManager *display_manager) g_assert (display != NULL); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS; - device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (display)); -G_GNUC_END_IGNORE_DEPRECATIONS; + device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager); g_assert (display_manager != NULL); default_display_opened = TRUE; @@ -955,9 +953,7 @@ gdk_input_other_event (GdkDisplay *display, return FALSE; } -G_GNUC_BEGIN_IGNORE_DEPRECATIONS; - device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (display)); -G_GNUC_END_IGNORE_DEPRECATIONS; + device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager); window = gdk_device_get_window_at_position (device_manager->core_pointer, &x, &y); if (window) diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index b13e6b7123..c7fbcb32ea 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -446,9 +446,9 @@ _gdk_win32_display_open (const gchar *display_name) _gdk_input_ignore_core = FALSE; - _gdk_display->device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32, - "display", _gdk_display, - NULL); + _gdk_device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32, + "display", _gdk_display, + NULL); _gdk_dnd_init (); diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 720e74981b..3bebec9fb7 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -465,7 +465,7 @@ find_window_for_mouse_event (GdkWindow* reported_window, GdkDeviceGrabInfo *grab; display = gdk_display_get_default (); - device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (display)); + device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager); grab = _gdk_display_get_last_device_grab (display, device_manager->core_pointer); if (grab == NULL) @@ -1107,7 +1107,7 @@ send_crossing_event (GdkDisplay *display, POINT pt; GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); - device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (display)); + device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager);_gdk_device_manager); grab = _gdk_display_has_device_grab (display, device_manager->core_pointer, 0); @@ -1751,7 +1751,7 @@ generate_button_event (GdkEventType type, if (_gdk_input_ignore_core) return; - device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (gdk_display_get_default ())); + device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager); event->button.window = window; event->button.time = _gdk_win32_get_next_tick (msg->time); @@ -2138,7 +2138,6 @@ gdk_event_translate (MSG *msg, GdkWindow *new_window; - GdkDeviceManager *device_manager; GdkDeviceManagerWin32 *device_manager_win32; GdkDeviceGrabInfo *keyboard_grab = NULL; @@ -2190,8 +2189,7 @@ gdk_event_translate (MSG *msg, return FALSE; } - device_manager = gdk_display_get_device_manager (display); - device_manager_win32 = GDK_DEVICE_MANAGER_WIN32 (device_manager); + device_manager_win32 = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager); keyboard_grab = _gdk_display_get_last_device_grab (display, device_manager_win32->core_keyboard); diff --git a/gdk/win32/gdkglobals-win32.c b/gdk/win32/gdkglobals-win32.c index 2398ca1047..68827867e7 100644 --- a/gdk/win32/gdkglobals-win32.c +++ b/gdk/win32/gdkglobals-win32.c @@ -28,6 +28,7 @@ #include "gdkprivate-win32.h" GdkDisplay *_gdk_display = NULL; +GdkDeviceManager *_gdk_device_manager = NULL; gint _gdk_offset_x, _gdk_offset_y; diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 25c44f0904..d7c072246b 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -259,6 +259,8 @@ extern LRESULT CALLBACK _gdk_win32_window_procedure (HWND, UINT, WPARAM, LPARAM) extern GdkDisplay *_gdk_display; +extern GdkDeviceManager *_gdk_device_manager; + /* Offsets to add to Windows coordinates (which are relative to the * primary monitor's origin, and thus might be negative for monitors * to the left and/or above the primary monitor) to get GDK