summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2017-11-03 23:19:22 +0100
committerBenjamin Otte <otte@redhat.com>2017-11-04 00:07:13 +0100
commit9323d098a6b80b396272ef9a1649218fbdced13b (patch)
tree2e6ee72e50d59e4d8e0faad7ecb7cd967a90a857 /gtk/gtkdnd.c
parente2996732b9ede9a0fb9e43e1ef2d468efd0021ae (diff)
downloadgtk+-9323d098a6b80b396272ef9a1649218fbdced13b.tar.gz
gdk: Cursors no longer have a display
Change constructors to reflect that. While doing so, also add a fallback argument to the cursor constructors, so it is now possible to create cursors with fallback.
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r--gtk/gtkdnd.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 606926ee94..40c14eeb4b 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -147,7 +147,6 @@ static void gtk_drag_get_event_actions (const GdkEvent *event,
GdkDragAction *suggested_action,
GdkDragAction *possible_actions);
static GdkCursor * gtk_drag_get_cursor (GtkWidget *widget,
- GdkDisplay *display,
GdkDragAction action,
GtkDragSourceInfo *info);
static void gtk_drag_update_cursor (GtkDragSourceInfo *info);
@@ -465,7 +464,6 @@ ensure_drag_cursor_pixbuf (int i)
static GdkCursor *
gtk_drag_get_cursor (GtkWidget *widget,
- GdkDisplay *display,
GdkDragAction action,
GtkDragSourceInfo *info)
{
@@ -484,19 +482,13 @@ gtk_drag_get_cursor (GtkWidget *widget,
if (drag_cursors[i].action == action)
break;
- if (drag_cursors[i].cursor != NULL)
- {
- if (display != gdk_cursor_get_display (drag_cursors[i].cursor))
- g_clear_object (&drag_cursors[i].cursor);
- }
-
if (drag_cursors[i].cursor == NULL)
- drag_cursors[i].cursor = gdk_cursor_new_from_name (display, drag_cursors[i].name);
+ drag_cursors[i].cursor = gdk_cursor_new_from_name (drag_cursors[i].name, NULL);
if (drag_cursors[i].cursor == NULL)
{
ensure_drag_cursor_pixbuf (i);
- drag_cursors[i].cursor = gdk_cursor_new_from_pixbuf (display, drag_cursors[i].pixbuf, 0, 0);
+ drag_cursors[i].cursor = gdk_cursor_new_from_pixbuf (drag_cursors[i].pixbuf, 0, 0, NULL);
}
return drag_cursors[i].cursor;
@@ -519,7 +511,6 @@ gtk_drag_update_cursor (GtkDragSourceInfo *info)
return;
cursor = gtk_drag_get_cursor (info->widget,
- gdk_cursor_get_display (info->cursor),
drag_cursors[i].action, info);
if (cursor != info->cursor)
@@ -1220,7 +1211,6 @@ gtk_drag_begin_internal (GtkWidget *widget,
&suggested_action, &possible_actions);
cursor = gtk_drag_get_cursor (widget,
- gtk_widget_get_display (widget),
suggested_action,
NULL);
@@ -1762,7 +1752,6 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
if (info->have_grab)
{
cursor = gtk_drag_get_cursor (widget,
- gtk_widget_get_display (widget),
gdk_drag_context_get_selected_action (context),
info);
if (info->cursor != cursor)