diff options
Diffstat (limited to 'frontends/amiga')
-rw-r--r-- | frontends/amiga/gui.c | 27 | ||||
-rw-r--r-- | frontends/amiga/gui.h | 2 |
2 files changed, 23 insertions, 6 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index b0aeb20db..9e5850a85 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -1092,9 +1092,15 @@ static void gui_init2(int argc, char** argv) sendcmd = ASPrintf("OPEN \"%s\" NEW%s", nsoption_charp(homepage_url), newtab); } 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"); + } + ami_quit=true; return; } @@ -2869,7 +2875,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw) struct IBox *bbox; /* Clear the last new tab list */ - gwin->gw->last_new_tab = NULL; + gwin->last_new_tab = NULL; if(gwin->tabs == 0) return; @@ -3507,6 +3513,16 @@ 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); + } + return NSERROR_OK; } @@ -3857,12 +3873,13 @@ gui_window_create(struct browser_window *bw, } else { struct Node *insert_after = existing->tab_node; - if(existing->last_new_tab) - insert_after = existing->last_new_tab; + if(g->shared->last_new_tab) + insert_after = g->shared->last_new_tab; Insert(&g->shared->tab_list, g->tab_node, insert_after); - existing->last_new_tab = g->tab_node; } + g->shared->last_new_tab = g->tab_node; + RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS], g->shared->win, NULL, CLICKTAB_Labels, &g->shared->tab_list, diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h index c1513a075..52411c427 100644 --- a/frontends/amiga/gui.h +++ b/frontends/amiga/gui.h @@ -101,6 +101,7 @@ struct gui_window_2 { struct List tab_list; ULONG tabs; ULONG next_tab; + struct Node *last_new_tab; struct Hook scrollerhook; struct form_control *control; browser_mouse_state mouse_state; @@ -152,7 +153,6 @@ struct gui_window struct gui_window_2 *shared; int tab; struct Node *tab_node; - struct Node *last_new_tab; int c_x; /* Caret X posn */ int c_y; /* Caret Y posn */ int c_w; /* Caret width */ |