diff options
author | Jonas Ã…dahl <jadahl@gmail.com> | 2016-04-26 15:31:33 +0800 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-05-05 15:03:59 -0400 |
commit | 0258c88949a17a0dd5ae93dcec3ba1bc62839577 (patch) | |
tree | 7fa40c522b6f40da544df26458ce5bdc23c41b84 /gdk/wayland/gdkdnd-wayland.c | |
parent | 3244d7a138a85ac4f7fb809340f4c86b43b303f5 (diff) | |
download | gtk+-0258c88949a17a0dd5ae93dcec3ba1bc62839577.tar.gz |
gdk/dnd: Don't use default display when getting cursor
Always associate a drag context with a GdkDisplay and use that when
getting a cursor for a given action.
If we don't do this, dragging on a window that doesn't use the default
display will make us use cursors from the wrong display.
https://bugzilla.gnome.org/show_bug.cgi?id=765565
Diffstat (limited to 'gdk/wayland/gdkdnd-wayland.c')
-rw-r--r-- | gdk/wayland/gdkdnd-wayland.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c index 069828d1af..37e9efa06f 100644 --- a/gdk/wayland/gdkdnd-wayland.c +++ b/gdk/wayland/gdkdnd-wayland.c @@ -427,7 +427,7 @@ gdk_wayland_drag_context_action_changed (GdkDragContext *context, { GdkCursor *cursor; - cursor = gdk_drag_get_cursor (action); + cursor = gdk_drag_get_cursor (context, action); gdk_drag_context_set_cursor (context, cursor); } @@ -528,6 +528,7 @@ _gdk_wayland_window_drag_begin (GdkWindow *window, context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL); context = GDK_DRAG_CONTEXT (context_wayland); + context->display = gdk_window_get_display (window); context->source_window = g_object_ref (window); context->is_source = TRUE; context->targets = g_list_copy (targets); @@ -552,13 +553,15 @@ _gdk_wayland_window_drag_begin (GdkWindow *window, } GdkDragContext * -_gdk_wayland_drop_context_new (struct wl_data_device *data_device) +_gdk_wayland_drop_context_new (GdkDisplay *display, + struct wl_data_device *data_device) { GdkWaylandDragContext *context_wayland; GdkDragContext *context; context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL); context = GDK_DRAG_CONTEXT (context_wayland); + context->display = display; context->is_source = FALSE; return context; |