[nautilus/gtk3-breakage] application: respect the 'exit-with-last-window' setting.
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gtk3-breakage] application: respect the 'exit-with-last-window' setting.
- Date: Wed, 27 Oct 2010 14:42:15 +0000 (UTC)
commit e18525a4f5e9b46c6e1b4bb5510fc15aa8188f80
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Oct 27 16:33:07 2010 +0200
application: respect the 'exit-with-last-window' setting.
If it's set, we quit immediately.
src/nautilus-application.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 4f931f1..c1eae73 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -741,10 +741,15 @@ nautilus_application_create_desktop_windows (NautilusApplication *application)
NautilusDesktopWindow *window;
GtkWidget *selection_widget;
int screens, i;
+ gboolean exit_with_last_window;
display = gdk_display_get_default ();
screens = gdk_display_get_n_screens (display);
+ exit_with_last_window =
+ g_settings_get_boolean (nautilus_preferences,
+ NAUTILUS_PREFERENCES_EXIT_WITH_LAST_WINDOW);
+
for (i = 0; i < screens; i++) {
selection_widget = get_desktop_manager_selection (display, i);
if (selection_widget != NULL) {
@@ -766,8 +771,13 @@ nautilus_application_create_desktop_windows (NautilusApplication *application)
nautilus_application_desktop_windows =
g_list_prepend (nautilus_application_desktop_windows, window);
- gtk_application_add_window (GTK_APPLICATION (application),
- GTK_WINDOW (window));
+ /* don't add the desktop windows to the GtkApplication hold toplevels
+ * if we should exit when the last window is closed.
+ */
+ if (!exit_with_last_window) {
+ gtk_application_add_window (GTK_APPLICATION (application),
+ GTK_WINDOW (window));
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]