Index: toolbar.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/toolbar.c,v
retrieving revision 1.75
diff -u -p -r1.75 toolbar.c
--- toolbar.c	9 Jan 2004 22:04:55 -0000	1.75
+++ toolbar.c	16 May 2004 20:50:29 -0000
@@ -166,7 +165,43 @@ arbitrary_url_notifier (GConfClient *cli
 static void
 go_location_cb (GtkAction *action, char *location, EphyWindow *window)
 {
-	ephy_window_load_url (window, location);
+	GdkEvent *event;
+	gboolean new_tab = FALSE;
+
+	event = gtk_get_current_event ();
+	if (event != NULL)
+	{
+		if (event->type == GDK_BUTTON_RELEASE)
+		{
+			guint modifiers, button, state;
+
+			modifiers = gtk_accelerator_get_default_mod_mask ();
+			button = event->button.button;
+			state = event->button.state;
+
+			/* middle-click or control-click */
+			if ((button == 1 && ((state & modifiers) == GDK_CONTROL_MASK)) ||
+			    (button == 2))
+			{
+				new_tab = TRUE;
+			}
+		}
+
+		gdk_event_free (event);
+	}
+
+	if (new_tab)
+	{
+		ephy_shell_new_tab (ephy_shell, window,
+				    ephy_window_get_active_tab (window),
+				    location,
+				    EPHY_NEW_TAB_OPEN_PAGE |
+				    EPHY_NEW_TAB_IN_EXISTING_WINDOW);
+	}
+	else
+	{
+		ephy_window_load_url (window, location);
+	}
 }
 
 static void
Index: bookmarks/ephy-bookmark-action.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmark-action.c,v
retrieving revision 1.30
diff -u -p -r1.30 ephy-bookmark-action.c
--- bookmarks/ephy-bookmark-action.c	17 Mar 2004 09:08:08 -0000	1.30
+++ bookmarks/ephy-bookmark-action.c	16 May 2004 20:50:29 -0000
@@ -69,7 +69,7 @@ enum
 
 static GObjectClass *parent_class = NULL;
 
-static guint ephy_bookmark_action_signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
 
 GType
 ephy_bookmark_action_get_type (void)
@@ -319,14 +319,40 @@ activate_cb (GtkWidget *widget, GtkActio
 		}
 	}
 
-	g_signal_emit (action,
-		       ephy_bookmark_action_signals[GO_LOCATION],
-		       0, location);
+	g_signal_emit (action, signals[GO_LOCATION], 0, location);
 
 	g_free (location);
 	g_free (text);
 }
 
+static gboolean
+button_press_cb (GtkWidget *widget,
+		 GdkEventButton *event,
+		 gpointer dummy)
+{
+	if (event->type == GDK_BUTTON_PRESS && event->button == 2)	
+	{
+		gtk_button_pressed (GTK_BUTTON (widget));
+	}
+
+	return FALSE;
+}
+
+static gboolean
+button_release_cb (GtkWidget *widget,
+                   GdkEventButton *event,
+		   EphyBookmarkAction *action)
+{
+	if (event->type == GDK_BUTTON_RELEASE && event->button == 2)	
+	{
+		gtk_button_released (GTK_BUTTON (widget));
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
 static void
 connect_proxy (GtkAction *action, GtkWidget *proxy)
 {
@@ -352,6 +378,10 @@ connect_proxy (GtkAction *action, GtkWid
 	{
 		button = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "button"));
 		g_signal_connect (button, "clicked", G_CALLBACK (activate_cb), action);
+		g_signal_connect (button, "button-press-event",
+				  G_CALLBACK (button_press_cb), NULL);
+		g_signal_connect (button, "button-release-event",
+				  G_CALLBACK (button_release_cb), action);
 
 		entry = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "entry"));
 		g_signal_connect (entry, "activate", G_CALLBACK (activate_cb), action);
@@ -450,7 +480,7 @@ ephy_bookmark_action_class_init (EphyBoo
 	object_class->set_property = ephy_bookmark_action_set_property;
 	object_class->get_property = ephy_bookmark_action_get_property;
 
-	ephy_bookmark_action_signals[GO_LOCATION] =
+	signals[GO_LOCATION] =
                 g_signal_new ("go_location",
                               G_OBJECT_CLASS_TYPE (object_class),
                               G_SIGNAL_RUN_FIRST,
