Commit a311ea29 authored by Gene Z. Ragan's avatar Gene Z. Ragan Committed by Gene Ragan
Browse files

Modified function to handle the folloing case: If a user has selected open

2000-07-10  Gene Z. Ragan  <gzr@eazel.com>

	* src/nautilus-window-manage-views.c:
	(open_location):
	Modified function to handle the folloing case:
	If a user has selected open location in new window
	in prefs, and a window is already open for the location,
	the window is activated and given focus.  This feature
	makes the most sense, but conflicts with the wording
	of the preferences item.  We need a way to express
	this feature in the prefs.
parent 84cdcd49
2000-07-10 Gene Z. Ragan <gzr@eazel.com>
* src/nautilus-window-manage-views.c:
(open_location):
Modified function to handle the folloing case:
If a user has selected open location in new window
in prefs, and a window is already open for the location,
the window is activated and given focus. This feature
makes the most sense, but conflicts with the wording
of the preferences item. We need a way to express
this feature in the prefs.
2000-07-10 Andy Hertzfeld <andy@eazel.com>
......
......@@ -34,6 +34,7 @@
#include "nautilus-window-manage-views.h"
#include <stdarg.h>
#include <gdk/gdkx.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomevfs/gnome-vfs-uri.h>
......@@ -641,8 +642,10 @@ open_location (NautilusWindow *window,
NautilusViewFrame *view_if_already_loading)
{
NautilusWindow *new_window;
NautilusWindow *traverse_window;
gboolean create_new_window;
GSList *element;
if (handle_unreadable_location (window, location)) {
return;
}
......@@ -658,6 +661,30 @@ open_location (NautilusWindow *window,
if (create_new_window) {
g_assert (view_if_already_loading == NULL);
/* Determine if a window with this uri is already open. If so, activate it */
/* FIXME: This may be the desired bahavior, but the prefs UI still says open
* new window. How can we resolve this inconsistancy?
*/
for (element = window->application->windows; element != NULL; element = element->next) {
traverse_window = element->data;
if (strcmp (traverse_window->location, location) == 0) {
gtk_widget_show_now (GTK_WIDGET (traverse_window));
gdk_window_raise (GTK_WIDGET (traverse_window)->window);
/* doesn't seem to be a better way to do this without an xlib call */
gdk_error_trap_push ();
XSetInputFocus (GDK_DISPLAY (),
GDK_WINDOW_XWINDOW (GTK_WIDGET (traverse_window)->window),
RevertToPointerRoot,
GDK_CURRENT_TIME);
gdk_flush();
gdk_error_trap_pop ();
return;
}
}
/* No open window found. Create a new one. */
new_window = nautilus_application_create_window (window->application);
nautilus_window_goto_uri (new_window, location);
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment