GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

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 #1058
parent 0c8e3369
Pipeline #152175 passed with stages
in 10 minutes and 9 seconds
......@@ -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. */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment