From 18099b317e67629b2581297d5a35a3a2d3dbab3e Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Mon, 16 Apr 2007 07:18:37 +0000 Subject: Middle clicking the Go button should open the location bar address content 2007-04-16 Diego Escalante Urrelo * src/ephy-go-action.c: Middle clicking the Go button should open the location bar address content in a new tab. Bug #362591. svn path=/trunk/; revision=6996 --- src/ephy-go-action.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ephy-go-action.c b/src/ephy-go-action.c index 25e5e5e53..a7a0c29b4 100644 --- a/src/ephy-go-action.c +++ b/src/ephy-go-action.c @@ -78,6 +78,15 @@ create_tool_item (GtkAction *action) return item; } +static void +button_clicked_cb (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + if (event->button == 1 || event->button == 2) + gtk_action_activate (GTK_ACTION (user_data)); +} + static void connect_proxy (GtkAction *action, GtkWidget *proxy) @@ -86,9 +95,9 @@ connect_proxy (GtkAction *action, if (GTK_IS_TOOL_ITEM (proxy)) { - g_signal_connect_object (GTK_BIN (proxy)->child, "clicked", - G_CALLBACK (gtk_action_activate), action, - G_CONNECT_SWAPPED); + g_signal_connect (GTK_BIN (proxy)->child, "button-press-event", + G_CALLBACK (button_clicked_cb), action + ); } } -- cgit