diff options
-rw-r--r-- | src/ephy-session.c | 2 | ||||
-rw-r--r-- | src/ephy-shell.c | 13 | ||||
-rw-r--r-- | src/ephy-shell.h | 1 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c index 6a8a8d9db..ba7706889 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -1615,7 +1615,7 @@ ephy_session_resume (EphySession *session, return; } - g_task_return_boolean (task, TRUE); + g_task_return_boolean (task, FALSE); g_object_unref (task); } diff --git a/src/ephy-shell.c b/src/ephy-shell.c index f4c9b707d..5fd9d3d26 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -293,7 +293,9 @@ session_load_cb (GObject *object, EphySession *session = EPHY_SESSION (object); EphyShell *shell = EPHY_SHELL (user_data); - ephy_session_resume_finish (session, result, NULL); + if (ephy_session_resume_finish (session, result, NULL)) + shell->priv->startup_context->startup_flags |= EPHY_STARTUP_RESUMING_SESSION; + ephy_shell_startup_continue (shell); } @@ -325,10 +327,10 @@ ephy_shell_activate (GApplication *application) EphyShellStartupContext *ctx; ctx = shell->priv->startup_context; - if (ctx->startup_flags != EPHY_STARTUP_OPEN_NOTHING) + if (ctx->startup_flags != EPHY_STARTUP_OPEN_NOTHING) { ephy_session_resume (ephy_shell_get_session (shell), ctx->user_time, NULL, session_load_cb, shell); - else + } else ephy_shell_start_headless (shell); } else ephy_shell_startup_continue (shell); @@ -1193,7 +1195,7 @@ open_uris_data_new (EphyShell *shell, data->flags |= EPHY_NEW_TAB_IN_NEW_WINDOW; } else if (startup_flags & EPHY_STARTUP_NEW_TAB || (new_windows_in_tabs && have_uris)) { data->flags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW | EPHY_NEW_TAB_JUMP | EPHY_NEW_TAB_PRESENT_WINDOW | EPHY_NEW_TAB_FROM_EXTERNAL; - } else if (!have_uris) { + } else if (!have_uris && !(startup_flags & EPHY_STARTUP_RESUMING_SESSION)) { data->window = NULL; data->flags |= EPHY_NEW_TAB_IN_NEW_WINDOW; } @@ -1225,6 +1227,9 @@ ephy_shell_open_uris_idle (OpenURIsData *data) WebKitNetworkRequest *request = NULL; #endif + if (!data->window && !data->flags) + return FALSE; + url = data->uris[data->current_uri]; if (url[0] == '\0') { page_flags = EPHY_NEW_TAB_HOME_PAGE; diff --git a/src/ephy-shell.h b/src/ephy-shell.h index 2c817484a..0390be324 100644 --- a/src/ephy-shell.h +++ b/src/ephy-shell.h @@ -114,6 +114,7 @@ typedef enum { EPHY_STARTUP_NEW_TAB = 1 << 0, EPHY_STARTUP_NEW_WINDOW = 1 << 1, EPHY_STARTUP_OPEN_NOTHING = 1 << 2, + EPHY_STARTUP_RESUMING_SESSION = 1 << 3, } EphyStartupFlags; typedef struct { |