summaryrefslogtreecommitdiff
path: root/gdk/quartz
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-10-25 20:38:38 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-10-26 10:36:32 -0400
commit7fa09a3e3a9ae7d2d4abe6b7fdfa122a0aaadd40 (patch)
tree893881a8ebdfceb7d3afb4a8cd5dbd9ee902442f /gdk/quartz
parent35fda80a4bb36deea3ad51318a2a3f6e26e1125a (diff)
downloadgtk+-7fa09a3e3a9ae7d2d4abe6b7fdfa122a0aaadd40.tar.gz
quartz: Stop using gdk_device_manager_list_devices
The function has been deprecated.
Diffstat (limited to 'gdk/quartz')
-rw-r--r--gdk/quartz/gdkevents-quartz.c24
-rw-r--r--gdk/quartz/gdkwindow-quartz.c32
2 files changed, 20 insertions, 36 deletions
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index f8fdaf526b..3f5151bccc 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 f15fbd0e28..0bcfac5d42 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);