[epiphany/gnome-3-20] session: Fix saving of multiple windows



commit 596ad7e4c15b2f416cfbe73d8a2cfd1e9f0cc73b
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Mar 23 20:23:29 2016 -0500

    session: Fix saving of multiple windows
    
    This regressed when we changed ephy_session_close to always save the
    session, even if a save was already in progress. In general that is
    fine, but it's broken in case a close has already occurred. The problem
    is that we actually close twice: once in ephy_shell_close_all_windows,
    and then again once for the last window in ephy_window_close. When
    closing the last window, other windows have already been closed, and
    therefore do not get saved. We need to keep the check here though, to
    keep session save working in the general case when closing a single
    window with the close button or Ctrl+W, where
    ephy_shell_close_all_windows never gets called. So the easiest way to
    fix this is to simply tolerate multiple calls to ephy_session_close, and
    bail early if the session was already closed; this ensures that we do
    not clobber the session state file when closing the final window if the
    session was closed by ephy_shell_close_all_windows.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764101

 src/ephy-session.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index f836053..ce3438a 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -523,6 +523,9 @@ ephy_session_close (EphySession *session)
     session->save_source_id = 0;
   }
 
+  if (session->closing)
+    return;
+
   session->closing = TRUE;
 
   policy = g_settings_get_enum (EPHY_SETTINGS_MAIN, EPHY_PREFS_RESTORE_SESSION_POLICY);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]