Index: src/ephy-session.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-session.c,v
retrieving revision 1.55
diff -u -p -r1.55 ephy-session.c
--- src/ephy-session.c	23 Mar 2006 16:43:28 -0000	1.55
+++ src/ephy-session.c	2 Apr 2006 02:59:02 -0000
@@ -689,6 +689,9 @@ session_command_open_uris (EphySession *
 			page_flags = EPHY_NEW_TAB_OPEN_PAGE;
 		}
 
+		/* Only open a new window if the url isn't already open */
+		if (ephy_session_present_window (session, url) == FALSE)
+		{
 		tab = ephy_shell_new_tab_full (shell, window,
 					       NULL /* parent tab */,
 					       url,
@@ -698,6 +701,7 @@ session_command_open_uris (EphySession *
 					       user_time);
 
 		window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab)));
+		}
 	}
 
 	g_object_unref (shell);
@@ -1582,6 +1586,57 @@ ephy_session_get_active_window (EphySess
 
 	return window;
 }
+
+/**
+ * ephy_session_present_window:
+ * @session: a #EphySession
+ * @address: a URL
+ *
+ * Searches the open windows for a tab with address @address. If found, presents
+ * the window and switches the window's active tab to it.
+ *
+ * Return value: %TRUE if a tab was found
+ **/
+gboolean
+ephy_session_present_window (EphySession *session,
+                const char *address)
+{
+   EphyWindow *window = NULL;
+   EphyTab *tab = NULL;
+   GList *tabs, *w, *t;
+   gboolean found = FALSE;
+
+   g_return_val_if_fail (EPHY_IS_SESSION (session), FALSE);
+   g_return_val_if_fail (address != NULL, FALSE);
+
+   for (w = session->priv->windows; w != NULL && found == FALSE; w = w->next)
+   {
+       if (!EPHY_IS_WINDOW (w->data)) continue;
+
+       window = EPHY_WINDOW (w->data);
+
+       tabs = ephy_window_get_tabs (window);
+       for (t = tabs; t != NULL && found == FALSE; t = t->next)
+       {
+           tab = EPHY_TAB (t->data);
+           char *tab_address;
+
+           tab_address = ephy_embed_get_location (ephy_tab_get_embed (tab), TRUE);	
+           found = tab_address != NULL && strcmp (tab_address, address) == 0;
+           g_free (tab_address);
+       }
+       g_list_free (tabs);
+   }
+
+   if (found)
+   {
+       ephy_window_jump_to_tab (window, tab);
+       gtk_window_present (GTK_WINDOW (window));
+   }
+   return found;
+}
+
 
 /**
  * ephy_session_queue_command:
Index: src/ephy-session.h
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-session.h,v
retrieving revision 1.5
diff -u -p -r1.5 ephy-session.h
--- src/ephy-session.h	2 Feb 2006 13:31:32 -0000	1.5
+++ src/ephy-session.h	2 Apr 2006 02:59:02 -0000
@@ -86,6 +86,8 @@ void		 ephy_session_add_window	(EphySess
 
 void		 ephy_session_remove_window	(EphySession *session,
 						 GtkWindow *window);
+gboolean	 ephy_session_present_window (EphySession *session,
+						  const char *address);
 
 void		 ephy_session_queue_command	(EphySession *session,
 						 EphySessionCommand op,
Index: src/bookmarks/ephy-bookmark-action.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmark-action.c,v
retrieving revision 1.79
diff -u -p -r1.79 ephy-bookmark-action.c
--- src/bookmarks/ephy-bookmark-action.c	24 Feb 2006 14:57:04 -0000	1.79
+++ src/bookmarks/ephy-bookmark-action.c	2 Apr 2006 02:59:04 -0000
@@ -32,6 +32,7 @@
 #include "ephy-gui.h"
 #include "ephy-debug.h"
 #include "ephy-dnd.h"
+#include "ephy-session.h"
 
 #include <glib/gi18n.h>
 #include <gtk/gtkwidget.h>
@@ -281,6 +282,7 @@ ephy_bookmark_action_activate (EphyBookm
 	EphyBookmarks *bookmarks;
 	const char *location;
 	char *address = NULL, *text = NULL;
+	EphySession *session;
 
 	g_return_if_fail (priv->node != NULL);
 
@@ -315,9 +317,14 @@ ephy_bookmark_action_activate (EphyBookm
 		address = ephy_bookmarks_resolve_address (bookmarks, location, text);
 	}
 	g_return_if_fail (address != NULL);
-
-	ephy_link_open (EPHY_LINK (action), address, NULL, flags);
-
+	
+	session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+	
+	/* Only open new window if the bookmark isn't already open */
+	if (ephy_session_present_window (session, address) == FALSE)
+	{
+		ephy_link_open (EPHY_LINK (action), address, NULL, flags);
+	}
 	g_free (address);
 	g_free (text);
 }
Index: src/bookmarks/ephy-bookmarks-editor.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmarks-editor.c,v
retrieving revision 1.192
diff -u -p -r1.192 ephy-bookmarks-editor.c
--- src/bookmarks/ephy-bookmarks-editor.c	10 Mar 2006 09:21:06 -0000	1.192
+++ src/bookmarks/ephy-bookmarks-editor.c	2 Apr 2006 02:59:04 -0000
@@ -1265,14 +1265,22 @@ ephy_bookmarks_editor_node_activated_cb 
 					 EphyNode *node,
 					 EphyBookmarksEditor *editor)
 {
+	EphySession *session;
 	const char *location;
 
 	location = ephy_node_get_property_string
 		(node, EPHY_NODE_BMK_PROP_LOCATION);
 	g_return_if_fail (location != NULL);
 
-	ephy_shell_new_tab (ephy_shell, NULL, NULL, location,
-			    EPHY_NEW_TAB_OPEN_PAGE);
+	session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+
+	/* only open a new window if there isn't already on open for this url */
+	if (ephy_session_present_window (session, location) == FALSE)
+	{
+		ephy_shell_new_tab (ephy_shell, NULL, NULL, location,
+					EPHY_NEW_TAB_OPEN_PAGE);
+	}
+
 }
 
 static void
