Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/e0c3e929f50396b8598fdcdbd9a1d2aa35ed2162
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/e0c3e929f50396b8598fdcdbd9a1d2aa35ed2162
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/e0c3e929f50396b8598fdcdbd9a1d2aa35ed2162

The branch, master has been updated
       via  e0c3e929f50396b8598fdcdbd9a1d2aa35ed2162 (commit)
       via  92601c26aef50f924df63161305888a96b70383c (commit)
       via  26c568af15eb266d188909c848406c07563286db (commit)
       via  1f96c0a413c26db03cd2921ef795972c47997747 (commit)
      from  7cbff32f92596119896582925978016e9d672f58 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=e0c3e929f50396b8598fdcdbd9a1d2aa35ed2162
commit e0c3e929f50396b8598fdcdbd9a1d2aa35ed2162
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Correct the function definitions so the ARexx port works on OS3 (untested)

diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c
index 13a5d22..062f00b 100644
--- a/frontends/amiga/arexx.c
+++ b/frontends/amiga/arexx.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2010 Chris Young <[email protected]>
+ * Copyright 2008-2010, 2016 Chris Young <[email protected]>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -71,22 +71,28 @@ enum
 static Object *arexx_obj = NULL;
 STATIC char result[100];
 
-STATIC VOID rx_open(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_quit(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_tofront(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_geturl(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_gettitle(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_version(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_save(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_pubscreen(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_back(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_forward(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_home(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_reload(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_windows(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_active(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_close(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_hotlist(struct ARexxCmd *, struct RexxMsg *);
+#ifdef __amigaos4__
+#define RXHOOKF(func) static VOID func(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unused)))
+#else
+#define RXHOOKF(func) static ASM VOID func(REG(a0, struct ARexxCmd* cmd), 
REG(a1, struct RexxMsg* msg))
+#endif
+
+RXHOOKF(rx_open);
+RXHOOKF(rx_quit);
+RXHOOKF(rx_tofront);
+RXHOOKF(rx_geturl);
+RXHOOKF(rx_gettitle);
+RXHOOKF(rx_version);
+RXHOOKF(rx_save);
+RXHOOKF(rx_pubscreen);
+RXHOOKF(rx_back);
+RXHOOKF(rx_forward);
+RXHOOKF(rx_home);
+RXHOOKF(rx_reload);
+RXHOOKF(rx_windows);
+RXHOOKF(rx_active);
+RXHOOKF(rx_close);
+RXHOOKF(rx_hotlist);
 
 STATIC struct ARexxCmd Commands[] =
 {
@@ -245,7 +251,7 @@ static struct gui_window *ami_find_tab(int window, int tab)
        return NULL;
 }
 
-STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_open)
 {
        struct dlnode *dln;
        struct gui_window *gw = cur_gw;
@@ -331,7 +337,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        nsurl_unref(url);
 }
 
-STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_save)
 {
        BPTR fh = 0;
        ULONG source_size;
@@ -360,19 +366,19 @@ STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        ami_reset_pointer(gw->shared);
 }
 
-STATIC VOID rx_quit(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_quit)
 {
        cmd->ac_RC = 0;
        ami_quit_netsurf();
 }
 
-STATIC VOID rx_tofront(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_tofront)
 {
        cmd->ac_RC = 0;
        ScreenToFront(scrn);
 }
 
-STATIC VOID rx_geturl(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_geturl)
 {
        struct gui_window *gw = cur_gw;
 
@@ -393,7 +399,7 @@ STATIC VOID rx_geturl(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((u
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_gettitle(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_gettitle)
 {
        struct gui_window *gw = cur_gw;
 
@@ -417,7 +423,7 @@ STATIC VOID rx_gettitle(struct ARexxCmd *cmd, struct 
RexxMsg *rxm __attribute__(
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_version(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_version)
 {
        cmd->ac_RC = 0;
 
@@ -483,7 +489,7 @@ STATIC VOID rx_version(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_pubscreen(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_pubscreen)
 {
        cmd->ac_RC = 0;
 
@@ -499,7 +505,7 @@ STATIC VOID rx_pubscreen(struct ARexxCmd *cmd, struct 
RexxMsg *rxm __attribute__
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_back(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_back)
 {
        struct gui_window *gw = cur_gw;
 
@@ -511,7 +517,7 @@ STATIC VOID rx_back(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        if(gw) ami_gui_history(gw->shared, true);
 }
 
-STATIC VOID rx_forward(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_forward)
 {
        struct gui_window *gw = cur_gw;
 
@@ -524,7 +530,7 @@ STATIC VOID rx_forward(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((
 
 }
 
-STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_home)
 {
        struct gui_window *gw = cur_gw;
        nsurl *url;
@@ -550,7 +556,7 @@ STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        }
 }
 
-STATIC VOID rx_reload(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_reload)
 {
        struct gui_window *gw = cur_gw;
 
@@ -572,7 +578,7 @@ STATIC VOID rx_reload(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((u
        }
 }
 
-STATIC VOID rx_windows(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_windows)
 {
        int windows = 0, tabs = 0;
        int window = 0;
@@ -587,7 +593,7 @@ STATIC VOID rx_windows(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_active)
 {
        int window = 0, tab = 0;
        struct gui_window *gw = cur_gw;
@@ -630,7 +636,7 @@ STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((u
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_close(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_close)
 {
        struct gui_window *gw = cur_gw;
 
@@ -647,7 +653,7 @@ STATIC VOID rx_close(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((un
        if(gw) browser_window_destroy(gw->bw);
 }
 
-STATIC VOID rx_hotlist(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_hotlist)
 {
        cmd->ac_RC = 0;
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=92601c26aef50f924df63161305888a96b70383c
commit 92601c26aef50f924df63161305888a96b70383c
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    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.

diff --git a/frontends/amiga/dist/Install b/frontends/amiga/dist/Install
index 5563190..dd4eb51 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 <[email protected]>\n"
+" * Copyright 2013, 2016 Chris Young <[email protected]>\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 0a324ca..fdbced2 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;


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=26c568af15eb266d188909c848406c07563286db
commit 26c568af15eb266d188909c848406c07563286db
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    document ACTIVE

diff --git a/frontends/amiga/dist/NetSurf.guide 
b/frontends/amiga/dist/NetSurf.guide
index ec1df8d..dd2f46d 100755
--- a/frontends/amiga/dist/NetSurf.guide
+++ b/frontends/amiga/dist/NetSurf.guide
@@ -198,9 +198,10 @@ NetSurf's ARexx port is called NETSURF.
 
 Commands are:
 
-@{b}OPEN URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N@{ub}
+@{b}OPEN 
URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N,ACTIVE/S@{ub}
 Opens URL in current window or a new window/tab if NEWWINDOW/NEWTAB is 
specified.  Saves the location without displaying if SAVEAS and a filename is 
specified (SAVEAS available in 2.6325)
 Note that if the URL is non-ASCII it is expected to be encoded in UTF-8 (file: 
references should always be in local charset due to filesystem limitations). 
Usually this is not relevant, as all normalised URLs will be in their ASCII 
form.
+ACTIVE forces a NEWTAB to be switched to even if this wouldn't normally be the 
case (available in 3.6)
 
 @{b}SAVE FILENAME/A,W=WINDOW/K/N,T=TAB/K/N@{ub} (2.6027)
 Saves current page source to FILENAME


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=1f96c0a413c26db03cd2921ef795972c47997747
commit 1f96c0a413c26db03cd2921ef795972c47997747
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Add an ACTIVE switch to the OPEN ARexx command to force new tabs to be 
active

diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c
index ad67368..13a5d22 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 9aaf182..0a324ca 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 52411c4..6d5188e 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
 


-----------------------------------------------------------------------

Summary of changes:
 frontends/amiga/arexx.c            |   78 ++++++++++++++++++++----------------
 frontends/amiga/dist/Install       |    4 +-
 frontends/amiga/dist/NetSurf.guide |    3 +-
 frontends/amiga/gui.c              |   35 ++++++++--------
 frontends/amiga/gui.h              |    5 +++
 5 files changed, 71 insertions(+), 54 deletions(-)

diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c
index ad67368..062f00b 100644
--- a/frontends/amiga/arexx.c
+++ b/frontends/amiga/arexx.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2010 Chris Young <[email protected]>
+ * Copyright 2008-2010, 2016 Chris Young <[email protected]>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -71,26 +71,32 @@ enum
 static Object *arexx_obj = NULL;
 STATIC char result[100];
 
-STATIC VOID rx_open(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_quit(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_tofront(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_geturl(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_gettitle(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_version(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_save(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_pubscreen(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_back(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_forward(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_home(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_reload(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_windows(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_active(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_close(struct ARexxCmd *, struct RexxMsg *);
-STATIC VOID rx_hotlist(struct ARexxCmd *, struct RexxMsg *);
+#ifdef __amigaos4__
+#define RXHOOKF(func) static VOID func(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unused)))
+#else
+#define RXHOOKF(func) static ASM VOID func(REG(a0, struct ARexxCmd* cmd), 
REG(a1, struct RexxMsg* msg))
+#endif
+
+RXHOOKF(rx_open);
+RXHOOKF(rx_quit);
+RXHOOKF(rx_tofront);
+RXHOOKF(rx_geturl);
+RXHOOKF(rx_gettitle);
+RXHOOKF(rx_version);
+RXHOOKF(rx_save);
+RXHOOKF(rx_pubscreen);
+RXHOOKF(rx_back);
+RXHOOKF(rx_forward);
+RXHOOKF(rx_home);
+RXHOOKF(rx_reload);
+RXHOOKF(rx_windows);
+RXHOOKF(rx_active);
+RXHOOKF(rx_close);
+RXHOOKF(rx_hotlist);
 
 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 },
@@ -245,7 +251,7 @@ static struct gui_window *ami_find_tab(int window, int tab)
        return NULL;
 }
 
-STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_open)
 {
        struct dlnode *dln;
        struct gui_window *gw = cur_gw;
@@ -293,6 +299,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])
@@ -327,7 +337,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        nsurl_unref(url);
 }
 
-STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_save)
 {
        BPTR fh = 0;
        ULONG source_size;
@@ -356,19 +366,19 @@ STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        ami_reset_pointer(gw->shared);
 }
 
-STATIC VOID rx_quit(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_quit)
 {
        cmd->ac_RC = 0;
        ami_quit_netsurf();
 }
 
-STATIC VOID rx_tofront(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_tofront)
 {
        cmd->ac_RC = 0;
        ScreenToFront(scrn);
 }
 
-STATIC VOID rx_geturl(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_geturl)
 {
        struct gui_window *gw = cur_gw;
 
@@ -389,7 +399,7 @@ STATIC VOID rx_geturl(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((u
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_gettitle(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_gettitle)
 {
        struct gui_window *gw = cur_gw;
 
@@ -413,7 +423,7 @@ STATIC VOID rx_gettitle(struct ARexxCmd *cmd, struct 
RexxMsg *rxm __attribute__(
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_version(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_version)
 {
        cmd->ac_RC = 0;
 
@@ -479,7 +489,7 @@ STATIC VOID rx_version(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_pubscreen(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_pubscreen)
 {
        cmd->ac_RC = 0;
 
@@ -495,7 +505,7 @@ STATIC VOID rx_pubscreen(struct ARexxCmd *cmd, struct 
RexxMsg *rxm __attribute__
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_back(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_back)
 {
        struct gui_window *gw = cur_gw;
 
@@ -507,7 +517,7 @@ STATIC VOID rx_back(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        if(gw) ami_gui_history(gw->shared, true);
 }
 
-STATIC VOID rx_forward(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_forward)
 {
        struct gui_window *gw = cur_gw;
 
@@ -520,7 +530,7 @@ STATIC VOID rx_forward(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((
 
 }
 
-STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_home)
 {
        struct gui_window *gw = cur_gw;
        nsurl *url;
@@ -546,7 +556,7 @@ STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((unu
        }
 }
 
-STATIC VOID rx_reload(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_reload)
 {
        struct gui_window *gw = cur_gw;
 
@@ -568,7 +578,7 @@ STATIC VOID rx_reload(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((u
        }
 }
 
-STATIC VOID rx_windows(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_windows)
 {
        int windows = 0, tabs = 0;
        int window = 0;
@@ -583,7 +593,7 @@ STATIC VOID rx_windows(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_active)
 {
        int window = 0, tab = 0;
        struct gui_window *gw = cur_gw;
@@ -626,7 +636,7 @@ STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((u
        cmd->ac_Result = result;
 }
 
-STATIC VOID rx_close(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_close)
 {
        struct gui_window *gw = cur_gw;
 
@@ -643,7 +653,7 @@ STATIC VOID rx_close(struct ARexxCmd *cmd, struct RexxMsg 
*rxm __attribute__((un
        if(gw) browser_window_destroy(gw->bw);
 }
 
-STATIC VOID rx_hotlist(struct ARexxCmd *cmd, struct RexxMsg *rxm 
__attribute__((unused)))
+RXHOOKF(rx_hotlist)
 {
        cmd->ac_RC = 0;
 
diff --git a/frontends/amiga/dist/Install b/frontends/amiga/dist/Install
index 5563190..dd4eb51 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 <[email protected]>\n"
+" * Copyright 2013, 2016 Chris Young <[email protected]>\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/dist/NetSurf.guide 
b/frontends/amiga/dist/NetSurf.guide
index ec1df8d..dd2f46d 100755
--- a/frontends/amiga/dist/NetSurf.guide
+++ b/frontends/amiga/dist/NetSurf.guide
@@ -198,9 +198,10 @@ NetSurf's ARexx port is called NETSURF.
 
 Commands are:
 
-@{b}OPEN URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N@{ub}
+@{b}OPEN 
URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N,ACTIVE/S@{ub}
 Opens URL in current window or a new window/tab if NEWWINDOW/NEWTAB is 
specified.  Saves the location without displaying if SAVEAS and a filename is 
specified (SAVEAS available in 2.6325)
 Note that if the URL is non-ASCII it is expected to be encoded in UTF-8 (file: 
references should always be in local charset due to filesystem limitations). 
Usually this is not relevant, as all normalised URLs will be in their ASCII 
form.
+ACTIVE forces a NEWTAB to be switched to even if this wouldn't normally be the 
case (available in 3.6)
 
 @{b}SAVE FILENAME/A,W=WINDOW/K/N,T=TAB/K/N@{ub} (2.6027)
 Saves current page source to FILENAME
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9aaf182..fdbced2 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;
@@ -3476,6 +3472,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 +3506,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 52411c4..6d5188e 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
 


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to