From c4aa241ef52c68990afff259a513f2902d5f34d7 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Wed, 7 Mar 2012 10:20:42 +0200 Subject: ephy-history-view: properly handle button-press-event So that it doesn't trigger a double-click in the first press. Use a handler instead of connecting to the signal. --- lib/widgets/ephy-history-view.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/widgets/ephy-history-view.c b/lib/widgets/ephy-history-view.c index 145f3cafa..2db3499c3 100644 --- a/lib/widgets/ephy-history-view.c +++ b/lib/widgets/ephy-history-view.c @@ -37,9 +37,8 @@ button_event_modifies_selection (GdkEventButton *event) } static gboolean -ephy_history_view_button_press_cb (GtkWidget *treeview, - GdkEventButton *event, - EphyHistoryView *view) +ephy_history_view_button_press (GtkWidget *treeview, + GdkEventButton *event) { GtkTreeSelection *selection; GtkTreePath *path = NULL; @@ -73,7 +72,7 @@ ephy_history_view_button_press_cb (GtkWidget *treeview, if (event->button == 3) { gboolean retval; - g_signal_emit_by_name (view, "popup_menu", &retval); + g_signal_emit_by_name (treeview, "popup_menu", &retval); } gtk_tree_path_free (path); } else @@ -85,6 +84,9 @@ ephy_history_view_button_press_cb (GtkWidget *treeview, static void ephy_history_view_class_init (EphyHistoryViewClass *klass) { + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + widget_class->button_press_event = ephy_history_view_button_press; } static void @@ -94,10 +96,6 @@ ephy_history_view_init (EphyHistoryView *self) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (self)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); - - g_signal_connect_object (self, "button_press_event", - G_CALLBACK (ephy_history_view_button_press_cb), - self, 0); } void -- cgit