diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-10 18:45:23 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-04-26 17:59:42 +0200 |
commit | 4f3058f1957134151078dce12eb677df9e61f97d (patch) | |
tree | 7b23b443a1b2c702dca38f7bf6e722f31cd67b73 /gtk/gtkiconview.c | |
parent | 74dbb057ed8fcacc609f9379e47fd804d47dfe04 (diff) | |
download | gtk+-4f3058f1957134151078dce12eb677df9e61f97d.tar.gz |
eventcontrollermotion: Port to new API model
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r-- | gtk/gtkiconview.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 45e4088d14..48da13353e 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -918,6 +918,7 @@ gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface) static void gtk_icon_view_init (GtkIconView *icon_view) { + GtkEventController *controller; GtkGesture *gesture; icon_view->priv = gtk_icon_view_get_instance_private (icon_view); @@ -966,11 +967,12 @@ gtk_icon_view_init (GtkIconView *icon_view) icon_view); gtk_widget_add_controller (GTK_WIDGET (icon_view), GTK_EVENT_CONTROLLER (gesture)); - icon_view->priv->motion_controller = gtk_event_controller_motion_new (GTK_WIDGET (icon_view)); - g_signal_connect (icon_view->priv->motion_controller, "leave", G_CALLBACK (gtk_icon_view_leave), + controller = gtk_event_controller_motion_new (); + g_signal_connect (controller, "leave", G_CALLBACK (gtk_icon_view_leave), icon_view); - g_signal_connect (icon_view->priv->motion_controller, "motion", G_CALLBACK (gtk_icon_view_motion), + g_signal_connect (controller, "motion", G_CALLBACK (gtk_icon_view_motion), icon_view); + gtk_widget_add_controller (GTK_WIDGET (icon_view), controller); icon_view->priv->key_controller = gtk_event_controller_key_new (GTK_WIDGET (icon_view)); g_signal_connect (icon_view->priv->key_controller, "key-pressed", G_CALLBACK (gtk_icon_view_key_pressed), @@ -1023,7 +1025,6 @@ gtk_icon_view_dispose (GObject *object) priv->cell_area = NULL; } - g_clear_object (&priv->motion_controller); g_clear_object (&priv->key_controller); G_OBJECT_CLASS (gtk_icon_view_parent_class)->dispose (object); |