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



commit 2cf09bd764df5a2f9a4cb3948e84ce52c924c3db
Author: Yetizone <andreii lisita gmail com>
Date:   Thu Feb 6 12:21:07 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 | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 23c52717f..c913de1a0 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -117,11 +117,19 @@ ephy_shell_startup_continue (EphyShell               *shell,
                              EphyShellStartupContext *ctx)
 {
   EphySession *session = ephy_shell_get_session (shell);
+  EphyEmbedShell *embed_shell = EPHY_EMBED_SHELL (shell);
+  EphyDownloadsManager *downloads_manager = ephy_embed_shell_get_downloads_manager (embed_shell);
+  gboolean downloads_in_progress = ephy_downloads_manager_has_active_downloads (downloads_manager);
 
   if (ctx->session_filename != NULL) {
     g_assert (session != NULL);
     ephy_session_load (session, (const char *)ctx->session_filename,
                        ctx->user_time, NULL, NULL, NULL);
+  } else if (downloads_in_progress && !ctx->arguments) {
+    /* If there are downloads in progress and there are no URLs passed in arguments */
+    /* then just present the active window without opening any new tabs */
+    GtkWindow *active_window = gtk_application_get_active_window (GTK_APPLICATION (shell));
+    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]