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



commit e68517c91f9c1be93a57dd668b874f8e869283b2
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 c6126eb..e8e37ab 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -1840,9 +1840,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));
 }
 
 
@@ -2207,6 +2206,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]