diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-09-10 20:36:11 +0100 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-09-10 20:36:11 +0100 |
commit | 1f96c0a413c26db03cd2921ef795972c47997747 (patch) | |
tree | 2b8dea3ba719068601da18c7c1a8b73dd87e8f40 | |
parent | 7cbff32f92596119896582925978016e9d672f58 (diff) | |
download | netsurf-1f96c0a413c26db03cd2921ef795972c47997747.tar.gz netsurf-1f96c0a413c26db03cd2921ef795972c47997747.tar.bz2 |
Add an ACTIVE switch to the OPEN ARexx command to force new tabs to be active
-rw-r--r-- | frontends/amiga/arexx.c | 6 | ||||
-rw-r--r-- | frontends/amiga/gui.c | 23 | ||||
-rw-r--r-- | frontends/amiga/gui.h | 5 |
3 files changed, 24 insertions, 10 deletions
diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c index ad67368a5..13a5d222f 100644 --- a/frontends/amiga/arexx.c +++ b/frontends/amiga/arexx.c @@ -90,7 +90,7 @@ STATIC VOID rx_hotlist(struct ARexxCmd *, struct RexxMsg *); STATIC struct ARexxCmd Commands[] = { - {"OPEN",RX_OPEN,rx_open,"URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL }, + {"OPEN",RX_OPEN,rx_open,"URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N,ACTIVE/S", 0, NULL, 0, 0, NULL }, {"QUIT",RX_QUIT,rx_quit,NULL, 0, NULL, 0, 0, NULL }, {"TOFRONT",RX_TOFRONT,rx_tofront,NULL, 0, NULL, 0, 0, NULL }, {"GETURL",RX_GETURL,rx_geturl, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL }, @@ -293,6 +293,10 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu NULL, gw->bw, NULL); + + if(cmd->ac_ArgList[6]) { + ami_gui_switch_to_new_tab(gw->shared); + } } } else if(cmd->ac_ArgList[1]) diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 9aaf182ee..0a324ca68 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -3476,6 +3476,19 @@ void ami_gui_set_scale(struct gui_window *gw, float scale) browser_window_set_scale(gw->bw, scale, true); } +void ami_gui_switch_to_new_tab(struct gui_window_2 *gwin) +{ + if(nsoption_bool(new_tab_is_active) == true) return; + + /* Switch to the just-opened tab (if new_tab_is_active, we already did!) */ + RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_TABS], + gwin->win, NULL, + CLICKTAB_CurrentNode, gwin->last_new_tab, + TAG_DONE); + + ami_switch_tab(gwin, false); +} + nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin) { nsurl *url; @@ -3497,15 +3510,7 @@ nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin) return error; } - if(nsoption_bool(new_tab_is_active) == false) { - /* Because this is a new blank tab, switch to it (if new_tab_is_active, we already did!) */ - RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_TABS], - gwin->win, NULL, - CLICKTAB_CurrentNode, gwin->last_new_tab, - TAG_DONE); - - ami_switch_tab(gwin, false); - } + ami_gui_switch_to_new_tab(gwin); return NSERROR_OK; } diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h index 52411c427..6d5188e44 100644 --- a/frontends/amiga/gui.h +++ b/frontends/amiga/gui.h @@ -245,5 +245,10 @@ STRPTR ami_gui_get_screen_title(void); * Set gui_globals back to the default for the browser context */ void ami_gui_set_default_gg(void); + +/** + * Switch to the most-recently-opened tab + */ +void ami_gui_switch_to_new_tab(struct gui_window_2 *gwin); #endif |