Fix the signalling to the old session of NetSurf from the newly-launched one.

No idea how this ever worked previously, as it was sending commands to the ARexx server instead of NetSurf.
This commit is contained in:
Chris Young 2016-07-03 22:08:29 +01:00
parent eb9571ede7
commit 59b29930d7
3 changed files with 12 additions and 5 deletions

View File

@ -133,6 +133,7 @@ bool ami_arexx_init(ULONG *rxsig)
AREXX_ReplyHook,NULL,
AREXX_DefExtension,"nsrx",
End;
return false;
}
}
@ -142,10 +143,15 @@ void ami_arexx_handle(void)
RA_HandleRexx(arexx_obj);
}
void ami_arexx_command(const char *cmd)
static void ami_arexx_command(const char *cmd, const char *port)
{
if(arexx_obj == NULL) return;
IDoMethod(arexx_obj, AM_EXECUTE, cmd, NULL, NULL, NULL, NULL, NULL);
IDoMethod(arexx_obj, AM_EXECUTE, cmd, port, NULL, NULL, NULL, NULL);
}
void ami_arexx_self(const char *cmd)
{
ami_arexx_command(cmd, "NETSURF");
}
void ami_arexx_execute(char *script)
@ -156,7 +162,7 @@ void ami_arexx_execute(char *script)
if((lock = Lock(script, ACCESS_READ))) {
DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH);
LOG("Executing script: %s", full_script_path);
ami_arexx_command(full_script_path);
ami_arexx_command(full_script_path, NULL);
UnLock(lock);
}
}

View File

@ -25,6 +25,6 @@
bool ami_arexx_init(ULONG *rxsig);
void ami_arexx_handle(void);
void ami_arexx_execute(char *);
void ami_arexx_command(const char *cmd);
void ami_arexx_self(const char *cmd);
void ami_arexx_cleanup(void);
#endif

View File

@ -1076,7 +1076,8 @@ static void gui_init2(int argc, char** argv)
} else {
sendcmd = ASPrintf("OPEN \"%s\" NEW",nsoption_charp(homepage_url));
}
ami_arexx_command(sendcmd);
ami_arexx_self(sendcmd);
FreeVec(sendcmd);
ami_quit=true;