diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index c0f9e79b68..eea6ecab15 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -14731,7 +14731,19 @@ static void handleAlertInLoop() { char caption[DEFAULT_STRING_LENGTH]; - strcpy(caption, ALERT_CAPTION_PREFIX); + const char* caption_prefix = getenv("NX_DIALOG_CAPTIONPREFIX"); + + if (!caption_prefix) { + // Use the hard-coded 'NX -' as default. + strncpy(caption, ALERT_CAPTION_PREFIX, DEFAULT_STRING_LENGTH); + caption[DEFAULT_STRING_LENGTH-1] = '\0'; + } + else + { + // Use what gets provided via NX_DIALOG_CAPTIONPREFIX (used in X2Go) + strncpy(caption, caption_prefix, DEFAULT_STRING_LENGTH-1); + caption[DEFAULT_STRING_LENGTH-1] = '\0'; + } int length = strlen(sessionId); diff --git a/nxproxy/man/nxproxy.1 b/nxproxy/man/nxproxy.1 index 2d5421d545..88301b5002 100644 --- a/nxproxy/man/nxproxy.1 +++ b/nxproxy/man/nxproxy.1 @@ -376,6 +376,14 @@ where is located in a different directory compared to the other programs, to make easier for the user to execute the program from the shell. +.TP 8 +.B NX_DIALOG_CAPTIONPREFIX +This variable can be used to override the default caption prefix for +agent calls to nxdialog. By default (if NX_DIALOG_CAPTIONPREFIX is +unset), the caption prefix gets set to 'NX - '. This variable is only +used if the proxy is running in server mode or if nxcomp code is run +as part of nxagent. + .TP 8 .B NX_SLAVE_CMD The full path to the slave channel handler. When the slave channel is