From 5c377cd285536f4bec2a6cfb6352a45cfe6cb39e Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 22 Feb 2020 11:51:10 +0000 Subject: GTK: Use new BW_CREATE_FOREGROUND flags This gets rid of temp_open_background which was, frankly, a bit of an eyesore. In addition it makes the open-in-new-tab context menu action behave like Firefox's with respect to the user's preference regarding whether or not to immediately focus new tabs. Signed-off-by: Daniel Silverstone --- frontends/gtk/toolbar.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'frontends/gtk/toolbar.c') diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c index f191bc174..1a6bc124e 100644 --- a/frontends/gtk/toolbar.c +++ b/frontends/gtk/toolbar.c @@ -926,7 +926,7 @@ nsgtk_browser_window_create(struct browser_window *bw, bool intab) { nserror res = NSERROR_OK; nsurl *url = NULL; - int flags = BW_CREATE_HISTORY; + int flags = BW_CREATE_HISTORY | BW_CREATE_FOREGROUND; if (intab) { flags |= BW_CREATE_TAB; @@ -1995,16 +1995,14 @@ static gboolean websearch_entry_activate_cb(GtkWidget *widget, gpointer data) SEARCH_WEB_OMNI_SEARCHONLY, &url); if (res == NSERROR_OK) { - temp_open_background = 0; bw = tb->get_bw(tb->get_ctx); res = browser_window_create( - BW_CREATE_HISTORY | BW_CREATE_TAB, + BW_CREATE_HISTORY | BW_CREATE_TAB | BW_CREATE_FOREGROUND, url, NULL, bw, NULL); - temp_open_background = -1; nsurl_unref(url); } if (res != NSERROR_OK) { -- cgit v1.2.3