From 92601c26aef50f924df63161305888a96b70383c Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Sep 2016 20:41:07 +0100 Subject: If NetSurf is already running, ensure when we open a new tab that it becomes active. This matches the behaviour in more mainstream web browsers. --- frontends/amiga/dist/Install | 4 ++-- frontends/amiga/gui.c | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'frontends/amiga') diff --git a/frontends/amiga/dist/Install b/frontends/amiga/dist/Install index 55631905e..dd4eb5149 100755 --- a/frontends/amiga/dist/Install +++ b/frontends/amiga/dist/Install @@ -320,7 +320,7 @@ (help @textfile-help) (dest "Rexx:NetSurf") (append "/*\n" -" * Copyright 2013 Chris Young \n" +" * Copyright 2013, 2016 Chris Young \n" " *\n" " * This file is part of NetSurf, http://www.netsurf-browser.org/\n" " *\n" @@ -346,7 +346,7 @@ "parse arg url\n" "\n" "if show('P', 'NETSURF') then do\n" -" address NETSURF 'OPEN' url 'NEWTAB'\n" +" address NETSURF 'OPEN' url 'NEWTAB ACTIVE'\n" " address NETSURF 'TOFRONT'\n" "end\n" "else do\n" diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 0a324ca68..fdbced232 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -1063,10 +1063,10 @@ static void gui_init2(int argc, char** argv) if(!notalreadyrunning) { STRPTR sendcmd = NULL; - char newtab[4] = "\0"; + char newtab[11] = "\0"; if(nsoption_bool(tab_new_session) == true) { - strcpy(newtab, "TAB"); + strcpy(newtab, "TAB ACTIVE"); } if(temp_homepage_url) { @@ -1078,12 +1078,8 @@ static void gui_init2(int argc, char** argv) ami_arexx_self(sendcmd); FreeVec(sendcmd); - if((nsoption_bool(tab_new_session) == true) && (nsoption_bool(new_tab_is_active) == true)) { - /* If we're opening a new tab and that tab will be active, bring the screen to the front. - *\todo consider if we should be bringing the window to the front too. - * If we're opening a new window, Intuition brings the screen to the front anyway. */ - ami_arexx_self("TOFRONT"); - } + /* Bring the screen to the front. Intuition may have already done this, but it doesn't hurt. */ + ami_arexx_self("TOFRONT"); ami_quit=true; return; -- cgit v1.2.3