[gtk+] quartz: Stop using gdk_device_manager_list_devices
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] quartz: Stop using gdk_device_manager_list_devices
- Date: Wed, 26 Oct 2016 14:45:32 +0000 (UTC)
commit 7fa09a3e3a9ae7d2d4abe6b7fdfa122a0aaadd40
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 25 20:38:38 2016 -0400
quartz: Stop using gdk_device_manager_list_devices
The function has been deprecated.
gdk/quartz/gdkevents-quartz.c | 24 ++++++++++++++----------
gdk/quartz/gdkwindow-quartz.c | 32 ++++++--------------------------
2 files changed, 20 insertions(+), 36 deletions(-)
---
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index f8fdaf5..3f5151b 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -127,12 +127,14 @@ _gdk_quartz_display_has_pending (GdkDisplay *display)
void
_gdk_quartz_events_break_all_grabs (guint32 time)
{
- GList *list, *l;
- GdkDeviceManager *device_manager;
+ GList *list = NULL, *l;
+ GdkSeat *seat;
+
+ seat = gdk_display_get_default_seat (_gdk_display);
+
+ list = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ list = g_list_prepend (devices, gdk_seat_get_pointer (seat));
- device_manager = gdk_display_get_device_manager (_gdk_display);
- list = gdk_device_manager_list_devices (device_manager,
- GDK_DEVICE_TYPE_MASTER);
for (l = list; l; l = l->next)
{
GdkDeviceGrabInfo *grab;
@@ -646,20 +648,22 @@ find_toplevel_under_pointer (GdkDisplay *display,
static GdkWindow *
find_toplevel_for_keyboard_event (NSEvent *nsevent)
{
- GList *list, *l;
+ GList *list = NULL, *l;
GdkWindow *window;
GdkDisplay *display;
GdkQuartzView *view;
- GdkDeviceManager *device_manager;
+ GdkSeat *seat;
view = (GdkQuartzView *)[[nsevent window] contentView];
window = [view gdkWindow];
display = gdk_window_get_display (window);
- device_manager = gdk_display_get_device_manager (display);
- list = gdk_device_manager_list_devices (device_manager,
- GDK_DEVICE_TYPE_MASTER);
+ seat = gdk_display_get_default_seat (display);
+
+ list = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ list = g_list_prepend (devices, gdk_seat_get_pointer (seat));
+
for (l = list; l; l = l->next)
{
GdkDeviceGrabInfo *grab;
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index f15fbd0..0bcfac5 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -166,34 +166,16 @@ gdk_window_impl_quartz_release_context (GdkWindowImplQuartz *window_impl,
}
static void
-check_grab_unmap (GdkWindow *window)
-{
- GList *list, *l;
- GdkDisplay *display = gdk_window_get_display (window);
- GdkDeviceManager *device_manager;
-
- device_manager = gdk_display_get_device_manager (display);
- list = gdk_device_manager_list_devices (device_manager,
- GDK_DEVICE_TYPE_FLOATING);
- for (l = list; l; l = l->next)
- {
- _gdk_display_end_device_grab (display, l->data, 0, window, TRUE);
- }
-
- g_list_free (list);
-}
-
-static void
check_grab_destroy (GdkWindow *window)
{
- GList *list, *l;
+ GList *list = NULL, *l;
GdkDisplay *display = gdk_window_get_display (window);
- GdkDeviceManager *device_manager;
+ GdkSeat *seat;
+
+ seat = gdk_display_get_default_seat (display);
- /* Make sure there is no lasting grab in this native window */
- device_manager = gdk_display_get_device_manager (display);
- list = gdk_device_manager_list_devices (device_manager,
- GDK_DEVICE_TYPE_MASTER);
+ list = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ list = g_list_prepend (devices, gdk_seat_get_pointer (seat));
for (l = list; l; l = l->next)
{
@@ -1131,8 +1113,6 @@ gdk_window_quartz_hide (GdkWindow *window)
SetSystemUIMode (kUIModeNormal, 0);
#endif
- check_grab_unmap (window);
-
_gdk_window_clear_update_area (window);
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]