summaryrefslogtreecommitdiff
path: root/frontends/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-09-04 17:35:32 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-09-04 17:35:32 +0100
commit7b5639d9821ca94865e25bc7c53fb3f93108c455 (patch)
treef101a37bae543bb97a9f133a3e6ec3a9e287d80f /frontends/amiga
parent239205033ccdd215c1fcc058be2c844ea03e4870 (diff)
downloadnetsurf-7b5639d9821ca94865e25bc7c53fb3f93108c455.tar.gz
netsurf-7b5639d9821ca94865e25bc7c53fb3f93108c455.tar.bz2
When opening a new blank tab, always switch to it.
Diffstat (limited to 'frontends/amiga')
-rw-r--r--frontends/amiga/gui.c19
-rw-r--r--frontends/amiga/gui.h2
2 files changed, 16 insertions, 5 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index a530d62c2..9e5850a85 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -2875,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;
@@ -3513,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;
}
@@ -3863,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 */