GNOME Bugzilla – Bug 764101
Epiphany only saves 1 window in the session_state.xml
Last modified: 2016-03-29 18:25:57 UTC
Most probably, a regression because of bug 761811. Epiphany 3.20.0 and WebKit 2.12.0 I'm running Epiphany with the dconf key: "process-model" = "shared-secondary-process" The compilation was done with CMake args: '-DPORT=GTK -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-O0 -g1 -DNDEBUG -DG_DISABLE_CAST_CHECKS" -DCMAKE_CXX_FLAGS_RELEASE="-O0 -g1 -DNDEBUG -DG_DISABLE_CAST_CHECKS"' --- 1. Open Epiphany. 2. Open more than one window. 3. Quit Epiphany. When reopening Epiphany, only one of the previously opened windows will be restored. Upon checking the session_state.xml file we can see that only one of the windows was written in the file. I've also confirmed the same behavior with: "process-model" = "one-secondary-process-per-web-view"
c45ae0b29287353f3798428b7131d8ac2127da62 is the first bad commit commit c45ae0b29287353f3798428b7131d8ac2127da62 Author: Carlos Garcia Campos <cgarcia@igalia.com> Date: Thu Jan 14 17:59:13 2016 +0100 ephy-session: save and restore web view session state Using the new WebKit API available in 2.11.3. The session state is serialized and then encoded as Base-64 to be able to to save it in our current session state XML file. Now, we always save the session on close, since there are more things that might have changed in the state like the scroll position that we don't monitor to schedule saves. https://bugzilla.gnome.org/show_bug.cgi?id=119432 Hard to see what's wrong though....
(In reply to Andres Gomez from comment #0) > Most probably, a regression because of bug 761811. Copy and paste mistake. I was meaning 747860. Anyway, Michael found the regression commit ...
Created attachment 324638 [details] [review] 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.
Created attachment 324639 [details] [review] session: Fix typos Really ought to use __FUNCTION__ for these instead....
Comment on attachment 324638 [details] [review] session: Fix saving of multiple windows Ok
Attachment 324638 [details] pushed as 019ac9b - session: Fix saving of multiple windows