Commit 5b355cb8 authored by Andrei Lisita's avatar Andrei Lisita 🎮

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

Fixes GNOME/epiphany#1058
parent 0c8e3369
Pipeline #152175 passed with stages
in 10 minutes and 9 seconds
...@@ -118,6 +118,7 @@ ephy_shell_startup_continue (EphyShell *shell, ...@@ -118,6 +118,7 @@ ephy_shell_startup_continue (EphyShell *shell,
{ {
EphySession *session = ephy_shell_get_session (shell); EphySession *session = ephy_shell_get_session (shell);
gboolean new_window_option = (ctx->startup_mode == EPHY_STARTUP_NEW_WINDOW); 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) { if (ctx->session_filename != NULL) {
g_assert (session != NULL); g_assert (session != NULL);
...@@ -135,6 +136,14 @@ ephy_shell_startup_continue (EphyShell *shell, ...@@ -135,6 +136,14 @@ ephy_shell_startup_continue (EphyShell *shell,
uris = default_uris; uris = default_uris;
ephy_shell_open_uris (shell, uris, ctx->startup_mode, ctx->user_time); 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) { } else if (ctx->arguments || !session) {
/* Don't queue any window openings if no extra arguments given, */ /* Don't queue any window openings if no extra arguments given, */
/* since session autoresume will open one for us. */ /* since session autoresume will open one for us. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment