aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index ee1c0c293..a54f7f2d3 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -49,6 +49,7 @@
#include "ephy-page-menu-action.h"
#include "ephy-prefs.h"
#include "ephy-private.h"
+#include "ephy-session.h"
#include "ephy-settings.h"
#include "ephy-shell.h"
#include "ephy-state.h"
@@ -994,8 +995,10 @@ ephy_window_delete_event (GtkWidget *widget,
GdkEventAny *event)
{
EphyWindow *window = EPHY_WINDOW (widget);
+ EphySession *session;
EphyEmbed *modified_embed = NULL;
- GList *tabs, *l;
+ GList *tabs, *l, *windows;
+ guint number_windows;
gboolean modified = FALSE;
/* We ignore the delete_event if the disable_quit lockdown has been set
@@ -1039,6 +1042,18 @@ ephy_window_delete_event (GtkWidget *widget,
return TRUE;
}
+ /* If this is the last window, save its state in the session. */
+ session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+ windows = ephy_session_get_windows (session);
+ number_windows = g_list_length (windows);
+ g_list_free (windows);
+
+ if (number_windows == 1)
+ {
+ ephy_session_close (session);
+ return TRUE;
+ }
+
/* See bug #114689 */
gtk_widget_hide (widget);