gtk-demo: Use gtk_widget_add_controller for drag source

This commit is contained in:
Matthias Clasen 2020-01-07 01:06:39 -05:00
parent 8e8254feae
commit 1a5dece09c

View File

@ -344,9 +344,9 @@ do_clipboard (GtkWidget *do_widget)
/* make image a drag source */
source = gtk_drag_source_new ();
gtk_drag_source_attach (source, image, GDK_BUTTON1_MASK);
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
/* accept drops on image */
formats = gdk_content_formats_new (NULL, 0);
@ -378,7 +378,7 @@ do_clipboard (GtkWidget *do_widget)
source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
gtk_drag_source_attach (source, image, GDK_BUTTON1_MASK);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
/* accept drops on image */
formats = gdk_content_formats_new (NULL, 0);