From 19975fa6dd2d79fee4daf329eae68d6b2b9fc4d3 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Mar 2017 10:33:04 +0100 Subject: [PATCH 1/7] Xserver/Imakefile: Switch to pkg-config --libs-only-l zlib. pkg-config --libs zlib in Debian jessie returns buggy linker parameters. It includes the system's default multi-arch path for shared libs. When linking nxagent, having the system's default shared library path explicitly listed as a "-L" linker option confuses linking against the libXcomp*.so files in the build path. When linking nxagent, we don't want to link against the system's libXcomp*.so files, we want it to get linked explicitly against the just built libXcomp*.so files in nxcomp/ and nxcompshad/. This change assumes that -lzlib is always available in the system's default shared library path. --- nx-X11/programs/Xserver/Imakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 2af91821df..25e53cb485 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -284,7 +284,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ XPMLIB = -lXpm XMLLIB = `pkg-config --libs libxml-2.0` PIXMANLIB = `pkg-config --libs pixman-1` -ZLIB = `pkg-config --libs zlib` +ZLIB = `pkg-config --libs-only-l zlib` PNGLIB = `pkg-config --libs libpng` JPEGLIB = -ljpeg From 7afb0ace3442482b7fe7a1490c9d673e54acb78b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Mar 2017 11:26:16 +0100 Subject: [PATCH 2/7] Xserver/Imakefile: Change order of linker options, to that self-built components get mentioned first in the nxagent linker command. --- nx-X11/programs/Xserver/Imakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 25e53cb485..fcf7823e5c 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -341,7 +341,7 @@ NX_XSHADOWLIBNAME = libXcompshad.so #endif ServerTarget(nxagent,$(NXAGENTDIRS),$(NXAGENTOBJS), \ - $(LIBCWRAPPER) $(NXCOMPEXT) $(NXAGENTLIBS) $(LOADABLEEXTS),$(NXCOMPEXTSYSLIBS) $(NXAGENTSYSLIBS) $(NXAGENTNXLIBS)) + $(LIBCWRAPPER) $(NXCOMPEXT) $(NXAGENTLIBS) $(LOADABLEEXTS),$(NXAGENTNXLIBS) $(NXAGENTSYSLIBS) $(NXCOMPEXTSYSLIBS)) /* * Hard coded target to build a static nxagent server. From c30386e110ad0ed30b2f44ffb15bd45d4f3a8e2f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Mar 2017 10:45:51 +0100 Subject: [PATCH 3/7] Xserver/Imakefile: Drop redundant library path option -L../../../nx-X11/exports/lib when linking nxagent. As -L../../exports/lib is already present and points to the same location. --- nx-X11/programs/Xserver/Imakefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index fcf7823e5c..3b4ae5838f 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -308,7 +308,6 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS):: $(NXAGENTDIRS) #if defined(SunArchitecture) NXAGENTNXLIBS = -L/usr/sfw/lib \ -L../../../nxcomp \ - -L../../../nx-X11/exports/lib \ -L../../../nxcompshad \ -lrt \ -lXcomp \ @@ -317,7 +316,6 @@ NXAGENTNXLIBS = -L/usr/sfw/lib \ -lNX_X11 -lXext #elif defined(cygwinArchitecture) NXAGENTNXLIBS = -L../../../nxcomp \ - -L../../../nx-X11/exports/lib \ -L../../../nxcompshad \ -lXcomp \ -lXcompshad \ @@ -325,7 +323,6 @@ NXAGENTNXLIBS = -L../../../nxcomp \ -lNX_X11 -lXext #else NXAGENTNXLIBS = -L../../../nxcomp \ - -L../../../nx-X11/exports/lib \ -L../../../nxcompshad \ -lXcomp \ -lXcompshad \ From 45066e25cebe4c3b8c4cc4d485c99fde3573bdca Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 7 Mar 2017 20:52:43 +0100 Subject: [PATCH 4/7] nxcomp/Children.cpp: Don't generate warnings with duplicated NX paths. Fixes ArcticaProject/nx-libs#370. --- nxcomp/Children.cpp | 131 +++++++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 61 deletions(-) diff --git a/nxcomp/Children.cpp b/nxcomp/Children.cpp index 224a86f6d4..265ba4e377 100644 --- a/nxcomp/Children.cpp +++ b/nxcomp/Children.cpp @@ -260,58 +260,63 @@ int NXTransDialog(const char *caption, const char *message, // in the default NX path. // - strcpy(command, "nxclient"); + if (i == 0) + { - char newPath[DEFAULT_STRING_LIMIT]; + strcpy(command, "nxclient"); - strcpy(newPath, "/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"); + char newPath[DEFAULT_STRING_LIMIT]; - #ifdef __APPLE__ + strcpy(newPath, "/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"); - strcat(newPath, "/Applications/NX Client for OSX.app/Contents/MacOS:"); + #ifdef __APPLE__ - #endif + strcat(newPath, "/Applications/NX Client for OSX.app/Contents/MacOS:"); - #ifdef __CYGWIN32__ + #endif - strcat(newPath, ".:"); + #ifdef __CYGWIN32__ - #endif + strcat(newPath, ".:"); - int newLength = strlen(newPath); + #endif - char *oldPath = getenv("PATH"); + int newLength = strlen(newPath); - strncpy(newPath + newLength, oldPath, DEFAULT_STRING_LIMIT - newLength - 1); + char *oldPath = getenv("PATH"); - newPath[DEFAULT_STRING_LIMIT - 1] = '\0'; + strncpy(newPath + newLength, oldPath, DEFAULT_STRING_LIMIT - newLength - 1); - #ifdef WARNING - *logofs << "NXTransDialog: WARNING! Trying with path '" - << newPath << "'.\n" << logofs_flush; - #endif + newPath[DEFAULT_STRING_LIMIT - 1] = '\0'; - cerr << "Warning" << ": Trying with path '" << newPath - << "'.\n"; + #ifdef WARNING + *logofs << "NXTransDialog: WARNING! Trying with path '" + << newPath << "'.\n" << logofs_flush; + #endif - // - // Solaris doesn't seem to have - // function setenv(). - // + cerr << "Warning" << ": Trying with path '" << newPath + << "'.\n"; - #ifdef __sun + // + // Solaris doesn't seem to have + // function setenv(). + // - char newEnv[DEFAULT_STRING_LIMIT + 5]; + #ifdef __sun - sprintf(newEnv,"PATH=%s", newPath); + char newEnv[DEFAULT_STRING_LIMIT + 5]; - putenv(newEnv); + sprintf(newEnv,"PATH=%s", newPath); - #else + putenv(newEnv); - setenv("PATH", newPath, 1); + #else - #endif + setenv("PATH", newPath, 1); + + #endif + + } } // @@ -455,60 +460,64 @@ int NXTransClient(const char* display) // in the default NX path. // - strcpy(command, "nxclient"); + if (i == 0) + { - char newPath[DEFAULT_STRING_LIMIT]; + strcpy(command, "nxclient"); - strcpy(newPath, "/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"); + char newPath[DEFAULT_STRING_LIMIT]; - #ifdef __APPLE__ + strcpy(newPath, "/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"); - strcat(newPath, "/Applications/NX Client for OSX.app/Contents/MacOS:"); + #ifdef __APPLE__ - #endif + strcat(newPath, "/Applications/NX Client for OSX.app/Contents/MacOS:"); - #ifdef __CYGWIN32__ + #endif - strcat(newPath, ".:"); + #ifdef __CYGWIN32__ - #endif + strcat(newPath, ".:"); - int newLength = strlen(newPath); + #endif - char *oldPath = getenv("PATH"); + int newLength = strlen(newPath); - strncpy(newPath + newLength, oldPath, DEFAULT_STRING_LIMIT - newLength - 1); + char *oldPath = getenv("PATH"); - newPath[DEFAULT_STRING_LIMIT - 1] = '\0'; + strncpy(newPath + newLength, oldPath, DEFAULT_STRING_LIMIT - newLength - 1); - #ifdef WARNING - *logofs << "NXTransClient: WARNING! Trying with path '" - << newPath << "'.\n" << logofs_flush; - #endif + newPath[DEFAULT_STRING_LIMIT - 1] = '\0'; - cerr << "Warning" << ": Trying with path '" << newPath - << "'.\n"; + #ifdef WARNING + *logofs << "NXTransClient: WARNING! Trying with path '" + << newPath << "'.\n" << logofs_flush; + #endif - // - // Solaris doesn't seem to have - // function setenv(). - // + cerr << "Warning" << ": Trying with path '" << newPath + << "'.\n"; - #ifdef __sun + // + // Solaris doesn't seem to have + // function setenv(). + // - char newEnv[DEFAULT_STRING_LIMIT + 5]; + #ifdef __sun - sprintf(newEnv,"PATH=%s", newPath); + char newEnv[DEFAULT_STRING_LIMIT + 5]; - putenv(newEnv); + sprintf(newEnv,"PATH=%s", newPath); - #else + putenv(newEnv); - setenv("PATH", newPath, 1); + #else - #endif - } + setenv("PATH", newPath, 1); + #endif + } + + } // // Hopefully useless. // From c9fed1b89078eb8674d304e0cf62c5d75ba0a1a5 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Mar 2017 10:53:17 +0100 Subject: [PATCH 5/7] nxcomp,hw/nxagent/Dialog.c: Basic implementation of the NXTransCallbacksDispatcher. - As a starting point for newly implementing a callbacks dispatcher scenario that allows for capturing various session events and executing external tools (like dialog boxes, pulldown menus, etc.). - The callbacks dispatcher approach will finally deprecate the NX_CLIENT env var related code path in later releases of nxcomp/nxagent. In the nxagent binary: For now, the callbacks dispatcher code path is taken if the env var NX_CALLBACKS_DISPATCHER is set to an application that handles the dispatching of callbacks from nxagent. in /usr{/local}/bin/nxagent: If NX_CALLBACKS_DISPATCHER is an empty string, callbacks are disabled. If NX_CALLBACKS_DISPATCHER is unset and the dispatcher command /usr/{local/}{/]nx/bin/nxagent-callbacks-dispatcher cannot be found, nxagent falls back to its old NX_CLIENT related code path. --- nx-X11/programs/Xserver/hw/nxagent/Dialog.c | 11 +- nxcomp/Children.cpp | 143 ++++++++++++++++++++ nxcomp/Loop.cpp | 72 +++++++++- nxcomp/NX.h | 4 + 4 files changed, 227 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c index da448a1cd9..c6ad36b2cf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c @@ -180,6 +180,8 @@ void nxagentLaunchDialog(DialogType dialogType) int local; const char *window = NULL; + char *cbDispatcherCmd; + switch (dialogType) { case DIALOG_KILL_SESSION: @@ -319,9 +321,14 @@ void nxagentLaunchDialog(DialogType dialogType) sigprocmask(SIG_BLOCK, &set, &oldSet); - *pid = NXTransDialog(nxagentDialogName, message, window, - type, local, dialogDisplay); + cbDispatcherCmd = getenv("NX_CALLBACKS_DISPATCHER"); + if (cbDispatcherCmd == NULL) + *pid = NXTransDialog(nxagentDialogName, message, window, + type, local, dialogDisplay); + else + *pid = NXTransCallbacksDispatcher(nxagentDialogName, message, window, + type, local, dialogDisplay); #ifdef TEST fprintf(stderr, "nxagentLaunchDialog: Launched dialog %s with pid [%d] on display %s.\n", DECODE_DIALOG_TYPE(dialogType), *pid, dialogDisplay); diff --git a/nxcomp/Children.cpp b/nxcomp/Children.cpp index 265ba4e377..2910c9af70 100644 --- a/nxcomp/Children.cpp +++ b/nxcomp/Children.cpp @@ -75,6 +75,7 @@ extern void CleanupGlobal(); extern void InstallSignals(); +extern char *GetCallbacksDispatcherPath(); extern char *GetClientPath(); extern int CheckParent(const char *name, const char *type, @@ -108,6 +109,148 @@ static int NXTransKeeperHandler(int signal); static void NXTransKeeperCheck(); +int NXTransCallbacksDispatcher(const char *caption, const char *message, + const char *window, const char *type, int local, + const char* display) +{ + // + // Be sure log file is valid. + // + + if (logofs == NULL) + { + logofs = &cerr; + } + + int pid; + + #ifdef TEST + *logofs << "NXTransCallbacksDispatcher: Going to fork with NX pid '" + << getpid() << "'.\n" << logofs_flush; + #endif + + pid = Fork(); + + if (pid != 0) + { + if (pid < 0) + { + #ifdef TEST + *logofs << "NXTransCallbacksDispatcher: WARNING! Function fork failed. " + << "Error is " << EGET() << " '" << ESTR() + << "'.\n" << logofs_flush; + #endif + + cerr << "Warning" << ": Function fork failed. " + << "Error is " << EGET() << " '" << ESTR() + << "'.\n"; + } + #ifdef TEST + else + { + *logofs << "NXTransCallbacksDispatcher: Created NX dialog process " + << "with pid '" << pid << "'.\n" + << logofs_flush; + } + #endif + + return pid; + } + + #ifdef TEST + *logofs << "NXTransCallbacksDispatcher: Executing child with pid '" + << getpid() << "' and parent '" << getppid() + << "'.\n" << logofs_flush; + #endif + + SystemCleanup("NXTransCallbacksDispatcher"); + + char command[DEFAULT_STRING_LIMIT]; + + char *path = GetCallbacksDispatcherPath(); + + if (path != NULL) + { + + strcpy(command, path); + + delete [] path; + + MemoryCleanup("NXTransCallbacksDispatcher"); + + #ifdef TEST + *logofs << "NXTransCallbacksDispatcher: Running external NX dialog with caption '" + << caption << "' message '" << message << "' type '" + << type << "' local '" << local << "' display '" + << display << "'.\n" + << logofs_flush; + #endif + + int pulldown = (strcmp(type, "pulldown") == 0); + + char parent[DEFAULT_STRING_LIMIT]; + + snprintf(parent, DEFAULT_STRING_LIMIT, "%d", getppid()); + + parent[DEFAULT_STRING_LIMIT - 1] = '\0'; + + UnsetEnv("LD_LIBRARY_PATH"); + + if (local != 0) + { + if (pulldown) + { + execlp(command, command, "--dialog", type, "--caption", caption, + "--window", window, "--local", "--parent", parent, + "--display", display, NULL); + } + else + { + execlp(command, command, "--dialog", type, "--caption", caption, + "--message", message, "--local", "--parent", parent, + "--display", display, NULL); + } + } + else + { + if (pulldown) + { + execlp(command, command, "--dialog", type, "--caption", caption, + "--window", window, "--parent", parent, + "--display", display, NULL); + } + else + { + execlp(command, command, "--dialog", type, "--caption", caption, + "--message", message, "--parent", parent, + "--display", display, NULL); + } + } + + #ifdef WARNING + *logofs << "NXTransCallbacksDispatcher: WARNING! Couldn't start '" + << command << "'. " << "Error is " << EGET() + << " '" << ESTR() << "'.\n" << logofs_flush; + #endif + + cerr << "Warning" << ": Couldn't start '" << command + << "'. Error is " << EGET() << " '" << ESTR() + << "'.\n"; + } + + /* + * If we reach here, callbacks had been disabled... + */ + + exit(0); + +} + +// +// Start a nxclient process in dialog mode. +// + + // // Start a nxclient process in dialog mode. // diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp index 3710b64144..6543ad1ab6 100644 --- a/nxcomp/Loop.cpp +++ b/nxcomp/Loop.cpp @@ -649,6 +649,7 @@ static int SetCompressionLan(); // char *GetClientPath(); +char *GetCallbacksDispatcherPath(); static char *GetSystemPath(); static char *GetHomePath(); @@ -737,7 +738,13 @@ static char systemDir[DEFAULT_STRING_LENGTH] = { 0 }; static char tempDir[DEFAULT_STRING_LENGTH] = { 0 }; // -// Actually the full path to the client. +// Actually the full path to the callbacks dispatcher. +// + +static char callbacksDispatcherDir[DEFAULT_STRING_LENGTH] = { 0 }; + +// +// for backwards compatibility: Actually the full path to the client. // static char clientDir[DEFAULT_STRING_LENGTH] = { 0 }; @@ -10448,6 +10455,69 @@ char *GetTempPath() return tempPath; } +char *GetCallbacksDispatcherPath() +{ + if (*callbacksDispatcherDir == '\0') + { + // + // Check the NX_CALLBACKS_DISPATCHER environment. + // + + const char *callbacksDispatcherEnv = getenv("NX_CALLBACKS_DISPATCHER"); + + if (callbacksDispatcherEnv == NULL || *callbacksDispatcherEnv == '\0') + { + #ifdef TEST + *logofs << "Loop: WARNING! NX_CALLBACKS_DISPATCHER environment variable is unset or empty. Disabling callbacks.\n" + << logofs_flush; + #endif + + HandleCleanup(); + } + + if (strlen(callbacksDispatcherEnv) > DEFAULT_STRING_LENGTH - 1) + { + #ifdef PANIC + *logofs << "Loop: PANIC! Invalid value for the NX " + << "callbacks dispatcher directory '" << callbacksDispatcherEnv + << "'.\n" << logofs_flush; + #endif + + cerr << "Error" << ": Invalid value for the NX " + << "callbacks dispatcher directory '" << callbacksDispatcherEnv + << "'.\n"; + + HandleCleanup(); + } + + strcpy(callbacksDispatcherDir, callbacksDispatcherEnv); + + #ifdef TEST + *logofs << "Loop: Assuming NX callbacks dispatcher location '" + << callbacksDispatcherDir << "'.\n" << logofs_flush; + #endif + } + + char *callbacksDispatcherPath = new char[strlen(callbacksDispatcherDir) + 1]; + + if (callbacksDispatcherPath == NULL) + { + #ifdef PANIC + *logofs << "Loop: PANIC! Can't allocate memory " + << "for the callbacks dispatcher path.\n" << logofs_flush; + #endif + + cerr << "Error" << ": Can't allocate memory " + << "for the callbacks dispatcher path.\n"; + + HandleCleanup(); + } + + strcpy(callbacksDispatcherPath, callbacksDispatcherDir); + + return callbacksDispatcherPath; +} + char *GetClientPath() { if (*clientDir == '\0') diff --git a/nxcomp/NX.h b/nxcomp/NX.h index 7ec79b4b16..af9551f563 100644 --- a/nxcomp/NX.h +++ b/nxcomp/NX.h @@ -433,6 +433,10 @@ extern int NXTransProxy(int fd, int mode, const char *display); extern int NXTransClient(const char *display); +extern int NXTransCallbacksDispatcher(const char *caption, const char *message, + const char *window, const char *type, int local, + const char *display); + extern int NXTransDialog(const char *caption, const char *message, const char *window, const char *type, int local, const char *display); From 44c9e78fa4e9238af9688f795e2005017ee06613 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Mar 2017 12:21:20 +0000 Subject: [PATCH 6/7] hw/nxagent/Dialog.c: Drop unused dialog for DIALOG_DISABLE_XKB_LOCAL. Fixes ArcticaProject/nx-libs#383. --- nx-X11/programs/Xserver/hw/nxagent/Dialog.c | 25 --------------------- nx-X11/programs/Xserver/hw/nxagent/Dialog.h | 17 +------------- 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c index c6ad36b2cf..59d53afa53 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c @@ -63,7 +63,6 @@ int nxagentEnableRandRModeDialogPid = 0; int nxagentDisableRandRModeDialogPid = 0; int nxagentEnableDeferModePid = 0; int nxagentDisableDeferModePid = 0; -int nxagentDisableXkbPid = 0; static int nxagentFailedReconnectionDialogPid = 0; @@ -159,15 +158,6 @@ void nxagentResetDialog(int pid) nxagentDisableDeferModePid = 0; } - else if (pid == nxagentDisableXkbPid) - { - #ifdef TEST - fprintf(stderr, "nxagentResetDialog: Resetting disable XKB dialog pid [%d].\n", - nxagentDisableXkbPid); - #endif - - nxagentDisableXkbPid = 0; - } } void nxagentLaunchDialog(DialogType dialogType) @@ -275,15 +265,6 @@ void nxagentLaunchDialog(DialogType dialogType) break; } - case DIALOG_DISABLE_XKB: - { - message = DIALOG_DISABLE_XKB_MESSAGE; - type = DIALOG_DISABLE_XKB_TYPE; - local = DIALOG_DISABLE_XKB_LOCAL; - pid = &nxagentDisableXkbPid; - - break; - } default: { #ifdef WARNING @@ -528,12 +509,6 @@ void nxagentTerminateDialog(DialogType type) break; } - case DIALOG_DISABLE_XKB: - { - pid = nxagentDisableXkbPid; - - break; - } default: { #ifdef WARNING diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h index 8c345d8a75..133dee2423 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h @@ -41,7 +41,6 @@ typedef enum DIALOG_FAILED_RECONNECTION, DIALOG_ENABLE_DEFER_MODE, DIALOG_DISABLE_DEFER_MODE, - DIALOG_DISABLE_XKB, DIALOG_LAST_TAG } DialogType; @@ -55,7 +54,6 @@ extern int nxagentEnableRandRModeDialogPid; extern int nxagentDisableRandRModeDialogPid; extern int nxagentEnableDeferModePid; extern int nxagentDisableDeferModePid; -extern int nxagentDisableXkbPid; extern char nxagentFailedReconnectionMessage[]; @@ -74,8 +72,7 @@ extern void nxagentTerminateDialogs(void); nxagentEnableRandRModeDialogPid == 0 && \ nxagentDisableRandRModeDialogPid == 0 && \ nxagentEnableDeferModePid == 0 && \ - nxagentDisableDeferModePid == 0 && \ - nxagentDisableXkbPid == 0) + nxagentDisableDeferModePid == 0) #define DECODE_DIALOG_TYPE(type) \ ((type) == DIALOG_KILL_SESSION ? "DIALOG_KILL_SESSION" : \ @@ -88,7 +85,6 @@ extern void nxagentTerminateDialogs(void); (type) == DIALOG_FAILED_RECONNECTION ? "DIALOG_FAILED_RECONNECTION" : \ (type) == DIALOG_ENABLE_DEFER_MODE ? "DIALOG_ENABLE_DEFER_MODE" : \ (type) == DIALOG_DISABLE_DEFER_MODE ? "DIALOG_DISABLE_DEFER_MODE" : \ - (type) == DIALOG_DISABLE_XKB ? "DIALOG_DISABLE_XKB" : \ "UNKNOWN_DIALOG") /* @@ -216,16 +212,5 @@ Ctrl+Alt+E to enable it again.\ #define DIALOG_DISABLE_DEFER_MODE_LOCAL 0 - -#define DIALOG_DISABLE_XKB_MESSAGE \ -\ -"\ -Changing layout is not allowed with your current display.\ -" - -#define DIALOG_DISABLE_XKB_TYPE "ok" - -#define DIALOG_DISABLE_XKB_LOCAL 0 - #endif /* __Dialog_H__ */ From 0922b664e817a747c0d66a7b89ceb5b791549fb4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Mar 2017 12:22:57 +0000 Subject: [PATCH 7/7] bin/nxagent.in: If not-yet-set and a script named nxagent-callbacks-dispatcher exists in the system's PATH, use this script's full path to set NX_CALLBACKS_DISPATCHER env var. --- bin/nxagent.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/nxagent.in b/bin/nxagent.in index 3a9dfc6490..e2675b763e 100644 --- a/bin/nxagent.in +++ b/bin/nxagent.in @@ -17,6 +17,12 @@ NX_LIBDIR=@@NXLIBDIR@@ +# [[ -v varname ]] requires bash 4.2 +if [ ! -v NX_CALLBACKS_DISPATCHER ] && \ + [ -x "${NX_LIBDIR}/bin/nxagent-callbacks-dispatcher" ]; then + export NX_CALLBACKS_DISPATCHER="${NX_LIBDIR}/bin/nxagent-callbacks-dispatcher" +fi + # make sure nxagent starts properly with pam_tmpdir.so being in use NX_TEMP=${NX_TEMP:-/tmp} export NX_TEMP