Commit 9c3d1080 authored by Javier Jardon's avatar Javier Jardon
Browse files

Do not use deprecated gdk_display_get_core_pointer()

Use gdk_device_manager_get_client_pointer() instead
parent 59bc9e88
......@@ -1033,13 +1033,15 @@ gdk_event_get_device (const GdkEvent *event)
{
GdkDisplay *display;
GdkDevice *core_pointer;
GdkDeviceManager *device_manager;
g_warning ("Event with type %d not holding a GdkDevice. "
"It is most likely synthesized outside Gdk/GTK+\n",
event->type);
display = gdk_drawable_get_display (event->any.window);
core_pointer = gdk_display_get_core_pointer (display);
device_manager = gdk_display_get_device_manager (display);
core_pointer = gdk_device_manager_get_client_pointer (device_manager);
if (event->type == GDK_KEY_PRESS ||
event->type == GDK_KEY_RELEASE)
......
......@@ -454,6 +454,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
GdkDeviceManager device_manager;
GdkEvent *event;
GdkWindow *window;
......@@ -465,8 +466,9 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
window = [[self contentView] gdkWindow];
device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
gdk_drag_context_set_device (current_context,
gdk_display_get_core_pointer (gdk_display_get_default ()));
gdk_device_manager_get_client_pointer (device_manager));
event = gdk_event_new (GDK_DRAG_ENTER);
event->dnd.window = g_object_ref (window);
......
......@@ -149,15 +149,18 @@ GdkDragContext *
gdk_drag_begin (GdkWindow *window,
GList *targets)
{
GdkDeviceManager *device_manager;
g_assert (_gdk_quartz_drag_source_context == NULL);
/* Create fake context */
_gdk_quartz_drag_source_context = gdk_drag_context_new ();
_gdk_quartz_drag_source_context->is_source = TRUE;
device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
gdk_drag_context_set_device (_gdk_quartz_drag_source_context,
gdk_display_get_core_pointer (gdk_display_get_default ()));
gdk_device_manager_get_client_pointer (device_manager));
return _gdk_quartz_drag_source_context;
}
......
......@@ -1212,6 +1212,7 @@ target_context_new (GdkWindow *window)
target_drag_context *result;
GdkDragContextPrivateWin32 *private;
GdkDevice *device;
GdkDeviceManager device_manager;
result = g_new0 (target_drag_context, 1);
......@@ -1221,7 +1222,8 @@ target_context_new (GdkWindow *window)
result->context->protocol = GDK_DRAG_PROTO_OLE2;
result->context->is_source = FALSE;
device = gdk_display_get_core_pointer (_gdk_display);
device_manager = gdk_display_get_device_manager (_gtk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (result->context, device);
result->context->source_window = NULL;
......@@ -1260,7 +1262,8 @@ source_context_new (GdkWindow *window,
result->context->protocol = GDK_DRAG_PROTO_OLE2;
result->context->is_source = TRUE;
device = gdk_display_get_core_pointer (_gdk_display);
device_manager = gdk_display_get_device_manager (_gtk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (result->context, device);
result->context->source_window = window;
......@@ -1475,6 +1478,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
gint nfiles, i;
gchar *fileName, *linkedFile;
GdkDevice *device;
GdkDeviceManager *device_manager;
if (msg->message == WM_DROPFILES)
{
......@@ -1484,7 +1488,8 @@ gdk_dropfiles_filter (GdkXEvent *xev,
context->protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
context->is_source = FALSE;
device = gdk_display_get_core_pointer (_gdk_display);
device_manager = gdk_display_get_device_manager (_gtk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (context, device);
context->source_window = _gdk_root;
......@@ -1701,6 +1706,7 @@ local_send_enter (GdkDragContext *context,
GdkDragContextPrivateWin32 *private;
GdkDragContext *new_context;
GdkDevice *device;
GdkDeviceManager *device_manager;
GDK_NOTE (DND, g_print ("local_send_enter: context=%p current_dest_drag=%p\n",
context,
......@@ -1718,7 +1724,8 @@ local_send_enter (GdkDragContext *context,
new_context->protocol = GDK_DRAG_PROTO_LOCAL;
new_context->is_source = FALSE;
device = gdk_display_get_core_pointer (_gdk_display);
device_manager = gdk_display_get_device_manager (_gtk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (new_context, device);
new_context->source_window = context->source_window;
......@@ -1852,12 +1859,14 @@ gdk_drag_begin (GdkWindow *window,
{
GdkDragContext *new_context;
GdkDevice *device;
GdkDeviceManager device_manager;
g_return_val_if_fail (window != NULL, NULL);
new_context = gdk_drag_context_new ();
device = gdk_display_get_core_pointer (_gdk_display);
device_manager = gdk_display_get_device_manager (_gtk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (new_context, device);
new_context->is_source = TRUE;
......
......@@ -2828,6 +2828,7 @@ xdnd_enter_filter (GdkXEvent *xev,
GdkEvent *event,
gpointer cb_data)
{
GdkDeviceManager *device_manager;
GdkDisplay *display;
GdkDisplayX11 *display_x11;
XEvent *xevent = (XEvent *)xev;
......@@ -2879,7 +2880,8 @@ xdnd_enter_filter (GdkXEvent *xev,
PRIVATE_DATA(new_context)->version = version;
/* FIXME: Should extend DnD protocol to have device info */
gdk_drag_context_set_device (new_context, gdk_display_get_core_pointer (display));
device_manager = gdk_display_get_device_manager (display);
gdk_drag_context_set_device (new_context, gdk_device_manager_get_client_pointer (device_manager));
new_context->source_window = gdk_window_lookup_for_display (display, source_window);
if (new_context->source_window)
......@@ -3168,7 +3170,8 @@ gdk_drag_begin (GdkWindow *window,
GdkDragContext *new_context;
GdkDisplay *display;
GdkDevice *device;
GdkDeviceManager *device_manager;
g_return_val_if_fail (window != NULL, NULL);
g_return_val_if_fail (GDK_WINDOW_IS_X11 (window), NULL);
......@@ -3183,7 +3186,8 @@ gdk_drag_begin (GdkWindow *window,
new_context->actions = 0;
display = gdk_drawable_get_display (GDK_DRAWABLE (window));
device = gdk_display_get_core_pointer (display);
device_manager = gdk_display_get_device_manager (display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (new_context, device);
return new_context;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment