[gtk+/gestures: 75/173] treeview: update to gesture widget-level API changes



commit 2a0aa015b039663522ace9047c9edda6c721d601
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Apr 8 21:02:44 2014 +0200

    treeview: update to gesture widget-level API changes

 gtk/gtktreeview.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 83e9d85..3e8849c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -1841,9 +1841,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));
 }
 
 
@@ -2208,6 +2207,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);
 }
 


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