aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2021-02-09 19:31:20 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-08 08:23:35 +0200
commit111ac2eed54438971554bd71115316472f1c9976 (patch)
treef7e0c910a042836181c98121d09508bb35c84693 /nx-X11/programs/Xserver
parent8fe2c114084743e8726ae39089e3aa1491d22719 (diff)
downloadnx-libs-111ac2eed54438971554bd71115316472f1c9976.tar.gz
nx-libs-111ac2eed54438971554bd71115316472f1c9976.tar.bz2
nx-libs-111ac2eed54438971554bd71115316472f1c9976.zip
nxagent: make X2GO support optional
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Icons.h2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Imakefile2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Init.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Init.h2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keystroke.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c5
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Splash.c7
10 files changed, 39 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 72d6d050c..9ecf2fb8a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -197,10 +197,12 @@ int ddxProcessArgument(int argc, char *argv[], int i)
nxagentProgName = strdup(basename(basec));
SAFE_free(basec);
+#ifdef X2GO
/*
* Check if we are running as X2Go Agent
*/
checkX2goAgent();
+#endif
}
#ifdef TEST
@@ -691,6 +693,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
SAFE_free(nxagentKeyboard);
+#ifdef X2GO
if (nxagentX2go && strcmp(argv[i], "null/null") == 0)
{
#ifdef TEST
@@ -701,6 +704,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
nxagentKeyboard = strdup("clone");
}
else
+#endif
{
nxagentKeyboard = strdup(argv[i]);
}
@@ -1775,11 +1779,13 @@ N/A
if (*nxagentWindowName == '\0')
{
+#ifdef X2GO
if(nxagentX2go)
{
snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "X2Go Agent");
}
else
+#endif
{
snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "NX Agent");
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index 89d49edf1..95b5aa3af 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
@@ -92,7 +92,9 @@ is" without express or implied warranty.
#include "compext/Compext.h"
#include NXAGENT_ICON_NAME
+#ifdef X2GO
#include X2GOAGENT_ICON_NAME
+#endif
/*
* Set here the required log level.
@@ -1849,6 +1851,7 @@ Bool nxagentMakeIcon(Display *disp, Pixmap *nxIcon, Pixmap *nxMask)
{
char** agentIconData;
+#ifdef X2GO
/*
* selecting x2go icon when running as X2Go agent
*/
@@ -1857,6 +1860,7 @@ Bool nxagentMakeIcon(Display *disp, Pixmap *nxIcon, Pixmap *nxMask)
agentIconData = x2goagentIconData;
}
else
+#endif
{
agentIconData = nxagentIconData;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Icons.h b/nx-X11/programs/Xserver/hw/nxagent/Icons.h
index a8a155cec..30457402b 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h
@@ -32,6 +32,8 @@
#define NXAGENT_ICON_NAME "nxagent.xpm"
+#ifdef X2GO
#define X2GOAGENT_ICON_NAME "x2goagent.xpm"
+#endif
#endif /* __Icons_H__ */
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
index a713467ae..94ae5b2ff 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile
+++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
@@ -206,6 +206,7 @@ INCLUDES = \
# This only has an effect if NX_TRANS_WAKEUP is also set for os/WaitFor.c
# NXAGENT_ARTSD enable special handling of MCOPGLOBALS property used by artsd.
# NXAGENT_RENDER_CLEANUP cleanup padding bits/bytes of glyphs to possibly increase compression rate
+# X2GO include code to support running as x2goagent
#
### macros not investigated yet:
#
@@ -259,6 +260,7 @@ DEFINES = \
-DRANDR_15_INTERFACE=1 \
-DPANORAMIX \
-UDEBUG_TREE \
+ -DX2GO \
-DSYSTEMFONTDIR=\"$(SYSTEMFONTDIR)\" \
$(NULL)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c
index e8e230956..b120e685e 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c
@@ -173,7 +173,8 @@ int nxagentSaveUnder;
*/
Bool nxagentDoFullGeneration = True;
- /*
+#ifdef X2GO
+/*
* True if agent is running as X2goAgent
* False if agent is running as NXAgent
*/
@@ -196,6 +197,7 @@ void checkX2goAgent(void)
else
nxagentX2go = False;
}
+#endif
/*
* Called at X server's initialization.
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h
index 6fa1bedd7..1b87f2296 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Init.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h
@@ -45,8 +45,10 @@ extern int nxagentDoFullGeneration;
extern int nxagentBackingStore;
extern int nxagentSaveUnder;
+#ifdef X2GO
extern int nxagentX2go;
void checkX2goAgent(void);
+#endif
extern ServerGrabInfoRec nxagentGrabServerInfo;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 731844874..2142adc8e 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -663,7 +663,8 @@ XkbError:
#endif
nxagentChangeOption(KeycodeConversion, KeycodeConversionOff);
- /*
+#ifdef X2GO
+ /*
* when cloning we do not want X2Go to set the keyboard
* via a keyboard file generated by nxagent. The defined
* method for switching that off is the creation of a dir
@@ -692,6 +693,7 @@ XkbError:
{
nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions);
}
+#endif
}
nxagentKeycodeConversionSetup();
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
index aff2e56ab..828649e5a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
@@ -314,11 +314,15 @@ void nxagentInitKeystrokes(Bool force)
done = True;
+#ifdef X2GO
if (nxagentX2go) {
homefile = "/.x2go/config/keystrokes.cfg";
etcfile = "/etc/x2go/keystrokes.cfg";
envvar = "X2GO_KEYSTROKEFILE";
- } else {
+ }
+ else
+#endif
+ {
homefile = "/.nx/config/keystrokes.cfg";
etcfile = "/etc/nxagent/keystrokes.cfg";
envvar = "NXAGENT_KEYSTROKEFILE";
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 500006868..febb47c12 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -1814,11 +1814,13 @@ N/A
#endif
}
+#ifdef X2GO
/*
* Setting WM_CLASS to "X2GoAgent" when running in X2Go Agent mode
* we need it to properly display all window parameters by some WMs
* (for example on Maemo)
*/
+#endif
{
#ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window with id [%ld].\n",
@@ -1827,12 +1829,14 @@ N/A
XClassHint hint;
+#ifdef X2GO
if(nxagentX2go)
{
hint.res_name = strdup("X2GoAgent");
hint.res_class = strdup("X2GoAgent");
}
else
+#endif
{
hint.res_name = strdup("NXAgent");
hint.res_class = strdup("NXAgent");
@@ -1850,6 +1854,7 @@ N/A
if (nxagentOption(Fullscreen))
{
+#ifdef NXAGENT_ONSTART
/*
* FIXME: Do we still need to set this property?
*/
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c
index a4dfb73d2..898868925 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c
@@ -48,6 +48,12 @@
#undef TEST
#undef DEBUG
+#ifndef X2GO
+void nxagentShowSplashWindow(XlibWindow parentWindow) {}
+void nxagentPaintLogo(XlibWindow win, int scale, int width, int height) {}
+void nxagentRemoveSplashWindow(void) {}
+Bool nxagentHaveSplashWindow(void) {return False;}
+#else
/*
* Colors used to paint the splash screen.
*/
@@ -361,3 +367,4 @@ void nxagentRemoveSplashWindow(void)
nxagentPixmapLogo = (XlibPixmap) 0;
}
}
+#endif /* ifdef X2GO */