Commit e5ecf797 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

Also consider desktop windows when deciding whether to fallback to home or

2006-02-26  Christian Neumair  <chris@gnome-de.org>

	* src/nautilus-application.c: (nautilus_application_get_n_windows):
	* src/nautilus-application.h:
	* src/nautilus-window-manage-views.c:
	(got_file_info_for_view_selection_callback):
	Also consider desktop windows when deciding whether to fallback to
	home or not. Fixes #331605.
parent 02e622e0
2006-02-26 Christian Neumair <chris@gnome-de.org>
* src/nautilus-application.c: (nautilus_application_get_n_windows):
* src/nautilus-application.h:
* src/nautilus-window-manage-views.c:
(got_file_info_for_view_selection_callback):
Also consider desktop windows when deciding whether to fallback to
home or not. Fixes #331605.
2006-02-25 Chao-Hsiung Liao <j_h_liau@yahoo.com.tw>
* configure.in: Add "zh_HK" to ALL_LINGUAS.
......
......@@ -154,6 +154,12 @@ nautilus_application_get_spatial_window_list (void)
return nautilus_application_spatial_window_list;
}
unsigned int
nautilus_application_get_n_windows (void)
{
return g_list_length (nautilus_application_window_list) +
g_list_length (nautilus_application_desktop_windows);
}
static void
nautilus_application_instance_init (NautilusApplication *application)
......
......@@ -72,6 +72,7 @@ void nautilus_application_startup (NautilusApplication
const char *urls[]);
GList * nautilus_application_get_window_list (void);
GList * nautilus_application_get_spatial_window_list (void);
unsigned int nautilus_application_get_n_windows (void);
NautilusWindow * nautilus_application_present_spatial_window (NautilusApplication *application,
NautilusWindow *requesting_window,
......
......@@ -668,14 +668,6 @@ another_navigation_window_already_showing (NautilusWindow *the_window)
return FALSE;
}
/* utility routine that returns true if there's one or fewer windows in the window list */
static gboolean
just_one_window (void)
{
return !eel_g_list_more_than_one_item
(nautilus_application_get_window_list ());
}
/*
* begin_location_change
......@@ -925,7 +917,9 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
* happens when a new window cannot display its initial URI.
*/
/* if this is the only window, we don't want to quit, so we redirect it to home */
if (just_one_window ()) {
if (nautilus_application_get_n_windows () <= 1) {
g_assert (nautilus_application_get_n_windows () == 1);
/* Make sure we re-use this window */
if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
NAUTILUS_SPATIAL_WINDOW (window)->affect_spatial_window_on_next_location_change = TRUE;
......
Markdown is supported
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