diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 969671bfbb..e090db4b47 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1842,9 +1842,8 @@ gtk_tree_view_init (GtkTreeView *tree_view) gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (tree_view->priv->multipress_gesture), FALSE); g_signal_connect (tree_view->priv->multipress_gesture, "pressed", G_CALLBACK (_tree_view_multipress_pressed), tree_view); - gtk_widget_add_gesture (GTK_WIDGET (tree_view), - tree_view->priv->multipress_gesture, - GTK_PHASE_BUBBLE); + gtk_widget_add_controller (GTK_WIDGET (tree_view), + GTK_EVENT_CONTROLLER (tree_view->priv->multipress_gesture)); } @@ -2209,6 +2208,13 @@ gtk_tree_view_destroy (GtkWidget *widget) _gtk_pixel_cache_free (tree_view->priv->pixel_cache); tree_view->priv->pixel_cache = NULL; + if (tree_view->priv->multipress_gesture) + { + gtk_widget_remove_controller (GTK_WIDGET (tree_view), + GTK_EVENT_CONTROLLER (tree_view->priv->multipress_gesture)); + g_clear_object (&tree_view->priv->multipress_gesture); + } + GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->destroy (widget); }