[epiphany/mcatanzaro/#677: 3/3] session: Delay loads only in browser or standalone mode



commit 75a1f634494345fea61530cd3c9c9917ae1f0823
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Feb 15 11:36:49 2019 -0600

    session: Delay loads only in browser or standalone mode
    
    Delayed loads are useful when restoring a big session in browser mode,
    because we don't want Epiphany to restore a bunch of tabs at the same
    time. In theory, in the unlikely event someone is using standalone mode,
    it could be useful here too. But otherwise, e.g. in web app mode, it's
    not desirable.
    
    Fixes #677

 src/ephy-session.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index b8253276d..465ac5053 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1156,13 +1156,21 @@ session_parse_embed (SessionParserContext *context,
    */
   if ((!was_loading || is_blank_page) && !crashed) {
     EphyNewTabFlags flags;
+    EphyEmbedShell *shell;
+    EphyEmbedShellMode mode;
     EphyEmbed *embed;
     EphyWebView *web_view;
-    gboolean delay_loading;
+    gboolean delay_loading = FALSE;
     WebKitWebViewSessionState *state = NULL;
 
-    delay_loading = g_settings_get_boolean (EPHY_SETTINGS_MAIN,
-                                            EPHY_PREFS_RESTORE_SESSION_DELAYING_LOADS);
+    shell = ephy_embed_shell_get_default ();
+    mode = ephy_embed_shell_get_mode (shell);
+
+    if (mode == EPHY_EMBED_SHELL_MODE_BROWSER ||
+        mode == EPHY_EMBED_SHELL_MODE_STANDALONE) {
+      delay_loading = g_settings_get_boolean (EPHY_SETTINGS_MAIN,
+                                              EPHY_PREFS_RESTORE_SESSION_DELAYING_LOADS);
+    }
 
     flags = EPHY_NEW_TAB_APPEND_LAST;
 


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