[epiphany/mcatanzaro/empty-session] Fix failure to launch any window on startup



commit 9c317beaa84b2c8c6d667f561071c8e52f1512ea
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Jan 11 15:02:15 2020 -0600

    Fix failure to launch any window on startup
    
    If we have an empty session state file, a file that exists on disk but
    contains no windows, then nothing happens when we start Epiphany until
    the user manually deletes the file from disk. That's bad. Show a window.

 src/ephy-shell.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 0acb0faa5..9ca010858 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -30,6 +30,7 @@
 #include "ephy-gui.h"
 #include "ephy-header-bar.h"
 #include "ephy-history-dialog.h"
+#include "ephy-link.h"
 #include "ephy-lockdown.h"
 #include "ephy-notification.h"
 #include "ephy-prefs.h"
@@ -116,6 +117,7 @@ ephy_shell_startup_continue (EphyShell               *shell,
                              EphyShellStartupContext *ctx)
 {
   EphySession *session = ephy_shell_get_session (shell);
+  EphyWindow *window;
 
   if (ctx->session_filename != NULL) {
     g_assert (session != NULL);
@@ -126,6 +128,9 @@ ephy_shell_startup_continue (EphyShell               *shell,
     /* since session autoresume will open one for us. */
     ephy_shell_open_uris (shell, (const char **)ctx->arguments,
                           ctx->startup_mode, ctx->user_time);
+  } else if (ephy_shell_get_n_windows (shell) == 0) {
+    window = ephy_window_new ();
+    ephy_link_open (EPHY_LINK (window), NULL, NULL, EPHY_LINK_HOME_PAGE);
   }
 }
 
@@ -462,7 +467,6 @@ session_load_cb (GObject      *object,
 {
   EphySession *session = EPHY_SESSION (object);
   EphyShellStartupContext *ctx = (EphyShellStartupContext *)user_data;
-
   ephy_session_resume_finish (session, result, NULL);
   ephy_shell_startup_continue (ephy_shell_get_default (), ctx);
 }


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