From 373836468b2c21f1c3706e521a603b9dba9dd41a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 14 Apr 2018 03:05:17 +0200 Subject: Call checkX2goAgent much earlier (in ddxProcessArgument) and adapt NXAGENTWINDOWNAMELENGTH to its result. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 15 ++++++++++++++- nx-X11/programs/Xserver/hw/nxagent/Init.c | 7 +------ nx-X11/programs/Xserver/hw/nxagent/Init.h | 1 + 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 801ee0b22..cdcde1224 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -56,6 +56,7 @@ is" without express or implied warranty. #include "servermd.h" #include "opaque.h" +#include "Init.h" #include "Agent.h" #include "Display.h" #include "Args.h" @@ -189,6 +190,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) nxagentProgName = argv[0]; + /* + * Check if we running as X2Go Agent + */ + checkX2goAgent(); + static Bool resetOptions = True; if (resetOptions == True) @@ -1805,7 +1811,14 @@ N/A if (*nxagentWindowName == '\0') { - snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "NX"); + if(nxagentX2go) + { + snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "X2Go Agent"); + } + else + { + snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "NX Agent"); + } } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 12f7f0b06..01acbbc16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -192,7 +192,7 @@ int nxagentX2go; * Checking if agent is x2go agent */ -void checkX2goAgent() +void checkX2goAgent(void) { extern const char *nxagentProgName; if( strcasecmp(nxagentProgName,"x2goagent") == 0) @@ -220,11 +220,6 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) #endif - /* - * Check if we running as X2Go Agent - */ - checkX2goAgent(); - /* * Print our pid and version information. */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h index 34a17067f..1bea17600 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h @@ -46,6 +46,7 @@ extern int nxagentBackingStore; extern int nxagentSaveUnder; extern int nxagentX2go; +void checkX2goAgent(void); extern ServerGrabInfoRec nxagentGrabServerInfo; -- cgit v1.2.3