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



commit a9ee1d2e10f17b85d0ff917cf4c14296ee4c44a6
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 | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 0acb0faa5..98babe02c 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"
@@ -126,6 +127,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) {
+    EphyWindow *window = ephy_window_new ();
+    ephy_link_open (EPHY_LINK (window), NULL, NULL, EPHY_LINK_HOME_PAGE);
   }
 }
 


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