Commit 405bc8f2 authored by Mike Gabriel's avatar Mike Gabriel

Add X2Go agent / NX agent flavouring via patch system:

- 200_nxagent_check-binary-x2go-flavour.patch - 201_nxagent_set-x2go-icon-if-x2goagent-flavour.patch - 300_nxagent_set-wm-class.patch - 999_nxagent_unbrand-nxagent-brand-x2goagent.patch
parent 19f24873
......@@ -3,6 +3,11 @@ nx-libs (2:3.5.0.2-1) UNRELEASED; urgency=low
* Rename nxagent-unbrand patch, so that is the last patch to be applied
(999_<patchname>).
* Drop NX agent unbrand patch from FreeNX.
* Add X2Go agent / NX agent flavouring via patch system:
- 200_nxagent_check-binary-x2go-flavour.patch
- 201_nxagent_set-x2go-icon-if-x2goagent-flavour.patch
- 300_nxagent_set-wm-class.patch
- 999_nxagent_unbrand-nxagent-brand-x2goagent.patch
-- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Wed, 11 Jan 2012 15:30:36 +0100
......
Description: Detect nxagent/x2goagent flavour
Whether the agent runs in X2Go or NX mode is decide by the
name of the binary that executes the code.
.
Binary name equal to nxagent -> (Free)NX flavour
Binary name equal to x2goagent -> X2Go flavour
Forwarded: not-needed
Author: Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
Last-Update: 2012-01-11
--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c
@@ -178,6 +178,29 @@
int nxagentDoFullGeneration = 1;
+ /*
+ * 1 if agent running as X2goAgent
+ * 0 if NX Agent
+ */
+int nxagentX2go;
+
+/*
+ * Checking if agent is x2go agent
+ */
+
+void checkX2goAgent()
+{
+ extern const char *__progname;
+ if( strcasecmp(__progname,"x2goagent") == 0)
+ {
+ fprintf(stderr, "\nrunning as X2Go Agent\n");
+ nxagentX2go=1;
+ }
+ else
+ nxagentX2go=0;
+}
+
+
/*
* Called at X server's initialization.
*/
@@ -194,6 +217,11 @@
#endif
/*
+ * Check if we running as X2Go Agent
+ */
+ checkX2goAgent();
+
+ /*
* Print our pid and version information.
*/
--- a/nx-X11/programs/Xserver/hw/nxagent/Init.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h
@@ -37,6 +37,8 @@
extern int nxagentBackingStore;
extern int nxagentSaveUnder;
+extern int nxagentX2go;
+
extern ServerGrabInfoRec nxagentGrabServerInfo;
#endif /* __Init_H__ */
Description: Set WM_CLASS to X2GoAgent/NXAgent
Depending on the binary name of the agent either NXAgent
or X2GoAgent is set as WM_Class.
.
This is needed for some window managers (like the one shipped with
Maemo)
.
The original WM_CLASS patch has been taken from the FreeNX patch
series, author unknown.
.
The nxagent/x2goagent has been done by the X2Go Project, author
see below.
Forwarded: not-needed
Author: Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
Last-Update: 2012-01-11
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -1756,6 +1756,42 @@
nxagentDefaultWindows[pScreen->myNum]);
#endif
+ /*
+ * 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)
+ */
+ if(nxagentX2go)
+ {
+ #ifdef TEST
+ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n",
+ nxagentDefaultWindows[pScreen->myNum]);
+ #endif
+ XClassHint hint;
+ hint.res_name=malloc(strlen("X2GoAgent")+1);
+ hint.res_class=malloc(strlen("X2GoAgent")+1);
+ strcpy(hint.res_name,"X2GoAgent");
+ strcpy(hint.res_class,"X2GoAgent");
+ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
+ free(hint.res_name);
+ free(hint.res_class);
+ } else {
+ #ifdef TEST
+ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n",
+ nxagentDefaultWindows[pScreen->myNum]);
+ #endif
+
+ XClassHint hint;
+ hint.res_name=malloc(strlen("NXAgent")+1);
+ hint.res_class=malloc(strlen("NXAgent")+1);
+ strcpy(hint.res_name,"NXAgent");
+ strcpy(hint.res_class,"NXAgent");
+ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
+ free(hint.res_name);
+ free(hint.res_class);
+ }
+
+
if (nxagentOption(Fullscreen))
{
nxagentFullscreenWindow = nxagentDefaultWindows[pScreen->myNum];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment