[gtk+] Update gdk-quartz functions for the demise of GdkDeviceManager.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Update gdk-quartz functions for the demise of GdkDeviceManager.
- Date: Sat, 5 Nov 2016 22:09:30 +0000 (UTC)
commit 2c642dd65419518f5f86ba1cffcecc0bbf1be6c1
Author: John Ralls <jralls ceridwen us>
Date: Sat Nov 5 15:03:54 2016 -0700
Update gdk-quartz functions for the demise of GdkDeviceManager.
gdk/quartz/GdkQuartzNSWindow.c | 6 ++----
gdk/quartz/gdkdevice-core-quartz.c | 8 ++++----
gdk/quartz/gdkevents-quartz.c | 20 ++++++++++----------
gdk/quartz/gdkwindow-quartz.c | 11 +++++------
4 files changed, 21 insertions(+), 24 deletions(-)
---
diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
index 5a99411..94acc90 100644
--- a/gdk/quartz/GdkQuartzNSWindow.c
+++ b/gdk/quartz/GdkQuartzNSWindow.c
@@ -575,13 +575,12 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
- GdkDeviceManager *device_manager;
GdkEvent *event;
GdkWindow *window;
if (current_context)
g_object_unref (current_context);
-
+
current_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT, NULL);
update_context_from_dragging_info (sender);
@@ -589,9 +588,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
current_context->display = gdk_window_get_display (window);
- device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
gdk_drag_context_set_device (current_context,
- gdk_device_manager_get_client_pointer (device_manager));
+ gdk_seat_get_pointer (gdk_display_get_default_seat
(current_context->display)));
event = gdk_event_new (GDK_DRAG_ENTER);
event->dnd.window = g_object_ref (window);
diff --git a/gdk/quartz/gdkdevice-core-quartz.c b/gdk/quartz/gdkdevice-core-quartz.c
index 6cb3b6d..da85990 100644
--- a/gdk/quartz/gdkdevice-core-quartz.c
+++ b/gdk/quartz/gdkdevice-core-quartz.c
@@ -128,14 +128,14 @@ gdk_quartz_device_core_get_state (GdkDevice *device,
gdouble *axes,
GdkModifierType *mask)
{
- gint x_int, y_int;
+ gdouble x_pos, y_pos;
- gdk_window_get_pointer (window, &x_int, &y_int, mask);
+ gdk_window_get_device_position_double (window, device, &x_pos, &y_pos, mask);
if (axes)
{
- axes[0] = x_int;
- axes[1] = y_int;
+ axes[0] = x_pos;
+ axes[1] = y_pos;
}
}
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 3f5151b..b119b35 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -127,15 +127,15 @@ _gdk_quartz_display_has_pending (GdkDisplay *display)
void
_gdk_quartz_events_break_all_grabs (guint32 time)
{
- GList *list = NULL, *l;
+ GList *devices = 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));
+ devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
- for (l = list; l; l = l->next)
+ for (l = devices; l; l = l->next)
{
GdkDeviceGrabInfo *grab;
@@ -149,7 +149,7 @@ _gdk_quartz_events_break_all_grabs (guint32 time)
_gdk_display_device_grab_update (_gdk_display, l->data, NULL, 0);
}
- g_list_free (list);
+ g_list_free (devices);
}
static void
@@ -648,7 +648,7 @@ find_toplevel_under_pointer (GdkDisplay *display,
static GdkWindow *
find_toplevel_for_keyboard_event (NSEvent *nsevent)
{
- GList *list = NULL, *l;
+ GList *devices = NULL, *l;
GdkWindow *window;
GdkDisplay *display;
GdkQuartzView *view;
@@ -661,10 +661,10 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
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));
+ devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
- for (l = list; l; l = l->next)
+ for (l = devices; l; l = l->next)
{
GdkDeviceGrabInfo *grab;
GdkDevice *device = l->data;
@@ -680,7 +680,7 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
}
}
- g_list_free (list);
+ g_list_free (devices);
return window;
}
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 3a86081..144eafd 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -168,16 +168,16 @@ gdk_window_impl_quartz_release_context (GdkWindowImplQuartz *window_impl,
static void
check_grab_destroy (GdkWindow *window)
{
- GList *list = NULL, *l;
+ GList *devices = NULL, *l;
GdkDisplay *display = gdk_window_get_display (window);
GdkSeat *seat;
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));
+ devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
- for (l = list; l; l = l->next)
+ for (l = devices; l; l = l->next)
{
GdkDeviceGrabInfo *grab;
@@ -190,7 +190,7 @@ check_grab_destroy (GdkWindow *window)
}
}
- g_list_free (list);
+ g_list_free (devices);
}
static void
@@ -941,7 +941,6 @@ _gdk_quartz_window_init_windowing (GdkDisplay *display,
_gdk_root->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */
_gdk_root->window_type = GDK_WINDOW_ROOT;
- _gdk_root->depth = 24;
_gdk_root->viewable = TRUE;
impl->wrapper = _gdk_root;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]