aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-03-07 16:20:42 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-03-07 16:20:42 +0800
commitc4aa241ef52c68990afff259a513f2902d5f34d7 (patch)
treed6bafe45698c02632f61d6a61b77d34712635538
parentc7a0006282b2723540f82c5545e642410031380f (diff)
downloadgsoc2013-epiphany-c4aa241ef52c68990afff259a513f2902d5f34d7.tar.gz
gsoc2013-epiphany-c4aa241ef52c68990afff259a513f2902d5f34d7.tar.zst
gsoc2013-epiphany-c4aa241ef52c68990afff259a513f2902d5f34d7.zip
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.
-rw-r--r--lib/widgets/ephy-history-view.c14
1 files 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