[gtk/dnd-gestures-2: 147/173] gtk-demo: Update the ::prepare handler



commit 6b7c5174ed7275cc00e5ca099820a25cd9081f57
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 7 14:48:09 2020 -0500

    gtk-demo: Update the ::prepare handler

 demos/gtk-demo/clipboard.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c
index 578bc6d7bf..5cad0626de 100644
--- a/demos/gtk-demo/clipboard.c
+++ b/demos/gtk-demo/clipboard.c
@@ -143,17 +143,13 @@ get_texture (GValue   *value,
     g_value_set_object (value, paintable);
 }
 
-static void
+static GdkContentProvider *
 prepare_drag (GtkDragSource *source,
               double         x,
               double         y,
               GtkWidget     *image)
 {
-  GdkContentProvider *content;
-
-  content = gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image);
-  gtk_drag_source_set_content (source, content);
-  g_object_unref (content);
+  return gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]