[epiphany] ephy-shell: Don't open new tab on startup if there are downloads in progress



commit 5b355cb864bd13b3878e50ddd7b344bee96a9f4b
Author: Yetizone <andreii lisita gmail com>
Date:   Fri Feb 14 11:46:59 2020 +0200

    ephy-shell: Don't open new tab on startup if there are downloads in progress
    
    Fixes https://gitlab.gnome.org/GNOME/epiphany/issues/1058

 src/ephy-shell.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index e48b9a9a7..e8776687f 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -118,6 +118,7 @@ ephy_shell_startup_continue (EphyShell               *shell,
 {
   EphySession *session = ephy_shell_get_session (shell);
   gboolean new_window_option = (ctx->startup_mode == EPHY_STARTUP_NEW_WINDOW);
+  GtkWindow *active_window = gtk_application_get_active_window (GTK_APPLICATION (shell));
 
   if (ctx->session_filename != NULL) {
     g_assert (session != NULL);
@@ -135,6 +136,14 @@ ephy_shell_startup_continue (EphyShell               *shell,
       uris = default_uris;
 
     ephy_shell_open_uris (shell, uris, ctx->startup_mode, ctx->user_time);
+  } else if (active_window && !ctx->arguments) {
+    /* If the application already has an active window and the --new-window */
+    /* option was not passed, then we should just present it */
+    /* This can happen for example if the user starts a long download and then */
+    /* closes the browser.*/
+    /* The window will still remain active and presenting it will have a */
+    /* session-resumed feel for the user. */
+    gtk_window_present (active_window);
   } else if (ctx->arguments || !session) {
     /* Don't queue any window openings if no extra arguments given, */
     /* since session autoresume will open one for us. */


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