aboutsummaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2012-01-11 16:17:51 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2012-01-11 16:17:51 +0100
commit405bc8f259f230947e5fe8341f0bab8f0f88c678 (patch)
tree2ffd91369f734eb7ef9e7dede9df7b08b5f82b91 /debian
parent19f24873388ce9a2136f8d3fe8145d6ce4576730 (diff)
downloadnx-libs-405bc8f259f230947e5fe8341f0bab8f0f88c678.tar.gz
nx-libs-405bc8f259f230947e5fe8341f0bab8f0f88c678.tar.bz2
nx-libs-405bc8f259f230947e5fe8341f0bab8f0f88c678.zip
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
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog5
-rw-r--r--debian/patches/200_nxagent_check-binary-x2go-flavour.patch64
-rw-r--r--debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.patch220
-rw-r--r--debian/patches/300_nxagent_set-wm-class.patch60
-rw-r--r--debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.patch329
5 files changed, 678 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 7faaac349..c38303645 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/debian/patches/200_nxagent_check-binary-x2go-flavour.patch b/debian/patches/200_nxagent_check-binary-x2go-flavour.patch
new file mode 100644
index 000000000..089b57022
--- /dev/null
+++ b/debian/patches/200_nxagent_check-binary-x2go-flavour.patch
@@ -0,0 +1,64 @@
+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__ */
diff --git a/debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.patch b/debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.patch
new file mode 100644
index 000000000..ff3861d6e
--- /dev/null
+++ b/debian/patches/201_nxagent_set-x2go-icon-if-x2goagent-flavour.patch
@@ -0,0 +1,220 @@
+Description: X2Go icon when run with x2goagent flavour
+ Depending on the binary name of the agent either nxagent.xpm
+ or x2go.xpm is used as window icon.
+Forwarded: not-needed
+Author: Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
+Last-Update: 2012-01-11
+--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c 2012-01-11 10:09:05.000000000 +0100
++++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c 2012-01-11 12:28:11.000000000 +0100
+@@ -77,6 +77,7 @@ is" without express or implied warranty.
+ #include "NXlib.h"
+
+ #include NXAGENT_ICON_NAME
++#include X2GOAGENT_ICON_NAME
+
+ /*
+ * Set here the required log level.
+@@ -1918,12 +1919,29 @@ Bool nxagentMakeIcon(Display *display, P
+ Bool success = False;
+ XlibPixmap IconPixmap;
+ XlibPixmap IconShape;
++ char* agent_icon_name;
++ char* agentIconData;
+
+- snprintf(default_path, PATH_MAX-1, "/usr/NX/share/images/%s", NXAGENT_ICON_NAME);
++ /*
++ * selecting x2go icon when running as X2Go agent
++ */
++ if(nxagentX2go)
++ {
++ agent_icon_name=X2GOAGENT_ICON_NAME;
++ agentIconData=x2goagentIconData;
++ }
++ else
++ {
++ agent_icon_name=NXAGENT_ICON_NAME;
++ agentIconData=nxagentIconData;
++ }
++
++
++ snprintf(default_path, PATH_MAX-1, "/usr/NX/share/images/%s", agent_icon_name);
+
+ if ((icon_fp = fopen(default_path, "r")) == NULL)
+ {
+- icon_fp = nxagentLookForIconFile(NXAGENT_ICON_NAME, "r", icon_path);
++ icon_fp = nxagentLookForIconFile(agent_icon_name, "r", icon_path);
+
+ if (icon_fp != NULL)
+ {
+@@ -1962,7 +1980,7 @@ Bool nxagentMakeIcon(Display *display, P
+ {
+ status = XpmCreatePixmapFromData(display,
+ DefaultRootWindow(display),
+- nxagentIconData,
++ agentIconData,
+ &IconPixmap,
+ &IconShape,
+ NULL);
+--- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h 2012-01-11 10:09:05.000000000 +0100
++++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h 2012-01-11 12:17:21.000000000 +0100
+@@ -24,6 +24,8 @@
+
+ #define NXAGENT_ICON_NAME "nxagent.xpm"
+
++#define X2GOAGENT_ICON_NAME "x2go.xpm"
++
+ #define NXAGENT_PLACEHOLDER_NAME "nxmissing.xpm"
+
+ #endif /* __Icons_H__ */
+--- a/nx-X11/programs/Xserver/hw/nxagent/x2go.xpm 1970-01-01 01:00:00.000000000 +0100
++++ b/nx-X11/programs/Xserver/hw/nxagent/x2go.xpm 2012-01-11 12:26:24.000000000 +0100
+@@ -0,0 +1,148 @@
++/* XPM */
++static char *x2goagentIconData[]={
++"128 128 17 1",
++". c None",
++"m c #323232",
++"l c #323232",
++"f c #323232",
++"e c #323232",
++"o c #323232",
++"# c #323232",
++"h c #323232",
++"i c #323232",
++"n c #323232",
++"d c #323232",
++"a c #323232",
++"g c #323232",
++"j c #323232",
++"b c #323232",
++"k c #323232",
++"c c #323232",
++".....#abccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccbde.....",
++"...fbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccgf...",
++"..#ccccaheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeijccckf..",
++".ecccgl..................................................................................................................ejcckf.",
++".bccd.....................................................................................................................mdccg.",
++"#cca.......................................................................................................................mjcce",
++"gckm........................................................................................................................eccd",
++"ccn..........................................................................................................................jcb",
++"cce..........................................................................................................................icc",
++"ccm..........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc............................................meeee..........................................................................ecc",
++"cc.........eeeeeeeeoiiiiiiiinggggggggjccccccccccccc....#ggggggggggggggggggggggggggggf.............ggggggggggggggggggggggf....ecc",
++"cc....meeeeoiiiiiiiinggggggggjccccccccccccccccccccc....icccccccccccccccccccccccccccce.............cccccccccccccccccccccce....ecc",
++"cc....................................meeeeeeeeoiii....icccccccccccccccccccccccccccce.............cccccccccccccccccccccce....ecc",
++"cc.......................................................menbccccccccccccccccccbhe..................logccccccccccccghe.......ecc",
++"cc...........................................................iccccccccccccccccdm.......................#cccccccccke..........ecc",
++"cc..............................................lee...........#cccccccccccccckm.........................jccccccckm...........ecc",
++"cc........feeeeeeeeoiiiiiiiiiaggggggggjcccccccccccc............icccccccccccccd..........................icccccccf............ecc",
++"cc....meeeeeoiiiiiiiinggggggggjcccccccccccccccccccciiiiii#m.....jcccccccccccci..........................icccccci.............ecc",
++"cc......................................eeeeeeeeeiiiiiiiiigl....eccccccccccccd..........................dcccccj..............ecc",
++"cc...............................................................dcccccccccccj..........................bccccce..............ecc",
++"cc...............................................................lccccccccccccl........................lccccca...............ecc",
++"cc.............................................meeeeeeee#iiiie....dccccccccccch........................icccccl...............ecc",
++"cc.........meeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccb....ecccccccccccb........................bccccn................ecc",
++"cc....meeeeiiiiiiiiiaggggggggbcccccccccccccccccccccccccccccccc#....gccccccccccco......................#cccckm................ecc",
++"cc....................................meeeeeeeeeiiiiiiiiiaggggd....#cccccccccccg......................bcccci.................ecc",
++"cc..................................................................bcccccccccccf....................#cccckm.................ecc",
++"cc..................................................................hcccccccccccd...................mkcccci..................ecc",
++"cc............................................meeeeeeeeoiiiiiiiil...mkcccccccccccl..................icccckm..................ecc",
++"cc.........eeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccccccn....dccccccccccci.................mkcccci...................ecc",
++"cc....meeeeeiiiiiiiiiaggggggggbccccccccccccccccccccccccccccccccckm...lccccccccccck.................icccckm...................ecc",
++"cc.....................................leeeeeeeeoiiiiiiiiigggggggo....accccccccccc#...............mkcccch....................ecc",
++"cc....................................................................ecccccccccccb...............iccccb.....................ecc",
++"cc.....................................................................jccccccccccce.............mkcccc#.....................ecc",
++"cc.............................................meeeeeeeeehiiiiiiii#....#ccccccccccca.............nccccb......................ecc",
++"cc........feeeeeeee#iiiiiiiiigggggggggkccccccccccccccccccccccccccccl....kcccccccccccl...........lccccc#......................ecc",
++"cc....meeeeeoiiiiiiiiigggggggggkcccccccccccccccccccccccccccccccccccd....icccccccccccd...........dccccb.......................ecc",
++"cc......................................leeeeeeeeoiiiiiiiingggggggga....mccccccccccckm.........lccccc#.......................ecc",
++"cc.......................................................................dccccccccccch.........dccccb........................ecc",
++"cc.......................................................................lcccccccccccb........lccccc#........................ecc",
++"cc.............................................meeeeeeeeoiiiiiiiingggo....gccccccccccc#.......dccccg.........................ecc",
++"cc.........meeeeeeeeoiiiiiiiinggggggggjccccccccccccccccccccccccccccccg....occcccccccccg......lccccce.........................ecc",
++"cc....meeeeiiiiiiiiiaggggggggbcccccccccccccccccccccccccccccccccccccccce....bccccccccccce.....gccccg..........................ecc",
++"cc....................................meeeeeeeeeiiiiiiiiigggggggggkcccd....#cccccccccccd....eccccce..........................ecc",
++"cc.........................................................................mkcccccccccccl...gccccg...........................ecc",
++"cc..........................................................................nccccccccccci..eccccce...........................ecc",
++"cc............................................meeeeeeeeoiiiiiiiingggggggm...lccccccccccckm.gccccg............................ecc",
++"cc.........eeeeeeeeoiiiiiiiinggggggggjcccccccccccccccccccccccccccccccccc#....dccccccccccc#eccccce............................ecc",
++"cc....meeeeeiiiiiiiiiaggggggggkcccccccccccccccccccccccccccccccccccccccccb....ecccccccccccbgccccg.............................ecc",
++"cc.....................................leeeeeeeeoiiiiiiiiigggggggggkccccco....gccccccccccccccccl.............................ecc",
++"cc............................................................................#cccccccccccccccd..............................ecc",
++"cc.............................................................................bccccccccccccccl..............................ecc",
++"cc.............................................leeeeeeeeeiiiiiiiiiagggggggi....icccccccccccccd...............................ecc",
++"cc........feeeeeeee#iiiiiiiingggggggggkccccccccccccccccccccccccccccccccccckm...mkccccccccccccl...............................ecc",
++"cc....meeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccccccccccci....dccccccccccca................................ecc",
++"cc......................................leeeeeeeeoiiiiiiiiigggggggggccccccck....lccccccccccckm...............................ecc",
++"cc...............................................................................accccccccccc#...............................ecc",
++"cc...............................................................................ecccccccccccb...............................ecc",
++"cc............................................leeeeeeeeeiiiiiiiiiaggggggggbcce....bccccccccccce..............................ecc",
++"cc.......feeeeeeee#iiiiiiiiigggggggggkcccccccccccccccccccccccccccccccccccccccd....#cccccccccccg..............................ecc",
++"cc....meeeeeeoiiiiiiiingggggggggccccccccccccccccccccccccccccccccccccccccccccccl....kcccccccccccl.............................ecc",
++"cc.......................................feeeeeeeehiiiiiiiidggggggggbccccccccci....ncccccccccccd.............................ecc",
++"cc...........................................................................mm....bccccccccccccm............................ecc",
++"cc................................................................................#ccccccccccccci............................ecc",
++"cc..........................................leeeeeeee#iiiiiiiidggggggggbcccccl....bccccccccccccck............................ecc",
++"cc......feeeeeeeehiiiiiiiiaggggggggkccccccccccccccccccccccccccccccccccccccccd....#ccccccccccccccc#...........................ecc",
++"cc....meeeeeee#iiiiiiiidggggggggjcccccccccccccccccccccccccccccccccccccccccccl....bcccccccccccccccb...........................ecc",
++"cc.......................................meeeeeeeeeiiiiiiiiigggggggggkcccccd....#cccccbccccccccccce..........................ecc",
++"cc..............................................................................bccccdhcccccccccccg..........................ecc",
++"cc.............................................................................#ccccclmkcccccccccccl.........................ecc",
++"cc..........................................meeeeeeeeeiiiiiiiiiaggggggggbkm....bccccd..ncccccccccccd.........................ecc",
++"cc.....leeeeeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccccci....hcccckl..lccccccccccccm........................ecc",
++"cc....meeeeeeeehiiiiiiiidggggggggbcccccccccccccccccccccccccccccccccccccckm...mkcccci....dccccccccccci........................ecc",
++"cc........................................leeeeeeee#iiiiiiiinggggggggjcci....icccckm....eccccccccccck........................ecc",
++"cc..........................................................................mkcccci......gccccccccccc#.......................ecc",
++"cc..........................................................................icccckm......#cccccccccccb.......................ecc",
++"cc.........................................leeeeeeeeoiiiiiiiiigggggggga....mkcccci........bccccccccccce......................ecc",
++"cc....meeeeeeeeoiiiiiiiiigggggggggkccccccccccccccccccccccccccccccccccci....icccckm........hcccccccccccg......................ecc",
++"cc.....feeeeeeeehiiiiiiiiaggggggggkcccccccccccccccccccccccccccccccccckm...mkcccci.........mkcccccccccccl.....................ecc",
++"cc.........................................feeeeeeeehiiiiiiiiagggggggh....icccckm..........icccccccccccd.....................ecc",
++"cc.......................................................................mkcccci...........lccccccccccccm....................ecc",
++"cc.......................................................................icccckm............dccccccccccci....................ecc",
++"cc...........................................eeeeeeeeehiiiiiiiidggga....mkcccci.............fccccccccccck....................ecc",
++"cc......feeeeeeee#iiiiiiiingggggggggccccccccccccccccccccccccccccccci....iccccb...............gccccccccccc#...................ecc",
++"cc....meeeeeeeoiiiiiiiiigggggggggbcccccccccccccccccccccccccccccccckm...mkcccc#...............occcccccccccb...................ecc",
++"cc........................................meeeeeeeeeiiiiiiiiidgggg#....iccccb.................bccccccccccce..................ecc",
++"cc....................................................................mkcccc#.................#cccccccccccg..................ecc",
++"cc....................................................................iccccb..................mkcccccccccccl.................ecc",
++"cc..........................................eeeeeeeeeiiiiiiiiiaga....mkcccc#...................icccccccccccd.................ecc",
++"cc.....leeeeeeee#iiiiiiiinggggggggjccccccccccccccccccccccccccccci....iccccb....................lccccccccccccm................ecc",
++"cc....meeeeeeee#iiiiiiiiigggggggggkcccccccccccccccccccccccccccckm...mkcccc#.....................dccccccccccci................ecc",
++"cc.........................................leeeeeeeeoiiiiiiiiiah....iccccb......................lccccccccccck................ecc",
++"cc.................................................................mkcccc#.......................gccccccccccc#...............ecc",
++"cc.................................................................dccccj........................ecccccccccccj...............ecc",
++"cc..........................................leeeeeeeeeiiiiiiih....lccccce.........................bccccccccccce..............ecc",
++"cc....meeeeeeeeeiiiiiiiiidgggggggggcccccccccccccccccccccccccci....dccccg..........................#ccccccccccca..............ecc",
++"cc.....feeeeeeeeiiiiiiiinggggggggbcccccccccccccccccccccccccckm...lccccce...........................kcccccccccccl.............ecc",
++"cc........................................leeeeeeeehiiiiiiiih....dccccg............................ncccccccccccd.............ecc",
++"cc..............................................................lccccce............................fccccccccccccf............ecc",
++"cc..............................................................dccccb..............................jcccccccccccg............ecc",
++"cc.........................................meeeeeeeeoiiiiil....lcccccn..............................icccccccccccce...........ecc",
++"cc......feeeeeeeehiiiiiiiigggggggggccccccccccccccccjgggggo.....gccccc#..............................eccccccccccccbm..........ecc",
++"cc....meeeeeeeoiiiiiiiiidgggggggggccccccccccccccccc...........hcccccco...............................cccccccccccccn..........ecc",
++"cc.........................................leeeeeee..........ecccccccn..............................lcccccccccccccc#.........ecc",
++"cc..........................................................#kccccccckf.............................nccccccccccccccc#........ecc",
++"cc........................................................ldcccccccccck#m.........................lncccccccccccccccccdl......ecc",
++"cc.........................................feeeeeee....ogjcccccccccccccccggi..................oggbcccccccccccccccccccccja....ecc",
++"cc.....leeeeeeee#iiiiiiiidggggggggbcccccccccccccccc....icccccccccccccccccccg..................icccccccccccccccccccccccccc....ecc",
++"cc....meeeeeeeehiiiiiiiiaggggggggkccccccccccccccccc....icccccccccccccccccccg..................icccccccccccccccccccccccccc....ecc",
++"cc........................................feeeeeeee..........................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cc...........................................................................................................................ecc",
++"cce..........................................................................................................................hcc",
++"ccn..........................................................................................................................acb",
++"jcb.........................................................................................................................lcca",
++"hcci........................................................................................................................acc#",
++"mkcc#......................................................................................................................dccb.",
++".occci...................................................................................................................macccf.",
++"..#cccbne.............................................................................................................menkccc#..",
++"...okccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccbe...",
++"....mhjccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccg#....."};
+
diff --git a/debian/patches/300_nxagent_set-wm-class.patch b/debian/patches/300_nxagent_set-wm-class.patch
new file mode 100644
index 000000000..765d6bc46
--- /dev/null
+++ b/debian/patches/300_nxagent_set-wm-class.patch
@@ -0,0 +1,60 @@
+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];
diff --git a/debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.patch b/debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.patch
new file mode 100644
index 000000000..e68d51b44
--- /dev/null
+++ b/debian/patches/999_nxagent_unbrand-nxagent-brand-x2goagent.patch
@@ -0,0 +1,329 @@
+Description: Unbrand NX Agent Startup Screen / Brand X2Go Agent Startup Screen
+ When launched with NX Agent flavour, the startup screen gets unbranded by
+ this patch (the !M logo does not get shown).
+ .
+ When launched with X2Go Agent flavour, the startup screen gets branded
+ with the X2GO logo.
+Forwarded: not-needed
+Author: Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
+Last-Update: 2012-01-11
+--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c2012-01-11 10:09:05.000000000 +0100
++++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c2012-01-11 14:47:51.000000000 +0100
+@@ -1407,6 +1408,7 @@ FIXME: Use of nxagentParentWindow is str
+ nxagentLogoBlack = 0x000000;
+ nxagentLogoRed = 0xff0000;
+ nxagentLogoWhite = 0xffffff;
++ nxagentLogoGray = 0x222222;
+ }
+ else
+ {
+@@ -1417,6 +1419,7 @@ FIXME: Use of nxagentParentWindow is str
+ nxagentLogoRed = nxagentLogoColor(0xff0000);
+ nxagentLogoBlack = nxagentLogoColor(0x000000);
+ nxagentLogoWhite = 0xffffff;
++ nxagentLogoGray = nxagentLogoColor(0x222222);
+ }
+
+ #ifdef WATCH
+@@ -2660,6 +2680,7 @@ Bool nxagentReconnectDisplay(void *p0)
+ nxagentLogoBlack = 0x000000;
+ nxagentLogoRed = 0xff0000;
+ nxagentLogoWhite = 0xffffff;
++ nxagentLogoGray = 0x222222;
+ }
+ else
+ {
+@@ -2670,6 +2691,7 @@ Bool nxagentReconnectDisplay(void *p0)
+ nxagentLogoRed = nxagentLogoColor(0xff0000);
+ nxagentLogoBlack = nxagentLogoColor(0x000000);
+ nxagentLogoWhite = 0xffffff;
++ nxagentLogoGray = nxagentLogoColor(0x222222);
+ }
+
+ useXpmIcon = nxagentMakeIcon(nxagentDisplay, &nxagentIconPixmap, &nxagentIconShape);
+--- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c 2012-01-11 10:09:05.000000000 +0100
++++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c 2012-01-11 15:03:39.000000000 +0100
+@@ -35,6 +35,7 @@
+ #include "Windows.h"
+ #include "Atoms.h"
+ #include "Trap.h"
++#include "Init.h"
+
+ /*
+ * Set here the required log level.
+@@ -53,6 +54,7 @@ int nxagentLogoDepth;
+ int nxagentLogoWhite;
+ int nxagentLogoRed;
+ int nxagentLogoBlack;
++int nxagentLogoGray;
+
+ void nxagentPaintLogo(Window win, GC gc, int scale, int width, int height);
+
+@@ -166,6 +168,15 @@ void nxagentPaintLogo(Window win, GC gc,
+ XPoint m[12];
+ int w, h, c, w2, h2;
+
++ /*
++ * Show only X2GO Logo when running as X2Go Agent
++ */
++ if(! nxagentX2go)
++ {
++ nxagentPixmapLogo = 0L;
++ return;
++ }
++
+ #ifdef DEBUG
+ fprintf(stderr, "nxagenShowtLogo: Got called.\n");
+ #endif
+@@ -218,75 +229,146 @@ void nxagentPaintLogo(Window win, GC gc,
+ XSetForeground(nxagentDisplay, gc, nxagentLogoRed);
+ XSetBackground(nxagentDisplay, gc, nxagentLogoWhite);
+
+- rect[0].x = w2-10*c; rect[0].y = h2-8*c;
+- rect[1].x = w2-10*c; rect[1].y = h2+8*c;
+- rect[2].x = w2+10*c; rect[2].y = h2+8*c;
+- rect[3].x = w2+10*c; rect[3].y = h2-8*c;
++ /*
++ * Draw X2GO Logo
++ */
+
++ /*
++ * Begin 'X'.
++ */
++
++ XSetForeground(nxagentDisplay, gc, nxagentLogoGray);
++ XSetBackground(nxagentDisplay, gc, nxagentLogoWhite);
++ rect[0].x = w2-7*c; rect[0].y = h2-5*c;
++ rect[1].x = w2-8*c; rect[1].y = h2-5*c;
++ rect[2].x = w2-4*c; rect[2].y = h2+3*c;
++ rect[3].x = w2-3*c; rect[3].y = h2+3*c;
+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
+- #ifdef NXAGENT_LOGO_DEBUG
+- fprintf(stderr, "filled red rect\n");
+- #endif
++ rect[0].x = w2-4*c; rect[0].y = h2-5*c;
++ rect[1].x = w2-3*c; rect[1].y = h2-5*c;
++ rect[2].x = w2-7*c; rect[2].y = h2+3*c;
++ rect[3].x = w2-8*c; rect[3].y = h2+3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
+- rect[0].x = w2-9*c; rect[0].y = h2-7*c;
+- rect[1].x = w2-9*c; rect[1].y = h2+7*c;
+- rect[2].x = w2+9*c; rect[2].y = h2+7*c;
+- rect[3].x = w2+9*c; rect[3].y = h2-7*c;
++ /*
++ * End 'X'.
++ */
+
+- XSetForeground(nxagentDisplay, gc, nxagentLogoWhite);
+- XSetBackground(nxagentDisplay, gc, nxagentLogoRed);
++ /*
++ * Start '2'.
++ */
++
++ rect[0].x = w2-2*c; rect[0].y = h2-5*c;
++ rect[1].x = w2-1*c; rect[1].y = h2-5*c;
++ rect[2].x = w2-1*c; rect[2].y = h2-3*c;
++ rect[3].x = w2-2*c; rect[3].y = h2-3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
++
++ rect[0].x = w2-2*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+2*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+2*c; rect[2].y = h2-4*c;
++ rect[3].x = w2-2*c; rect[3].y = h2-4*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
++ rect[0].x = w2+1*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+2*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+2*c; rect[2].y = h2-2*c;
++ rect[3].x = w2+1*c; rect[3].y = h2-2*c;
+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
++ rect[0].x = w2+2*c; rect[0].y = h2-2*c;
++ rect[1].x = w2+1*c; rect[1].y = h2-2*c;
++ rect[2].x = w2-2*c; rect[2].y = h2+2*c;
++ rect[3].x = w2-1*c; rect[3].y = h2+2*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
++
++
++ rect[0].x = w2-2*c; rect[0].y = h2+2*c;
++ rect[1].x = w2+2*c; rect[1].y = h2+2*c;
++ rect[2].x = w2+2*c; rect[2].y = h2+3*c;
++ rect[3].x = w2-2*c; rect[3].y = h2+3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+ /*
+- * Begin 'M'.
++ * End '2'.
+ */
+
+- m[0].x = w2-3*c; m[0].y = h2-5*c;
+- m[1].x = w2+7*c; m[1].y = h2-5*c;
+- m[2].x = w2+7*c; m[2].y = h2+5*c;
+- m[3].x = w2+5*c; m[3].y = h2+5*c;
+- m[4].x = w2+5*c; m[4].y = h2-3*c;
+- m[5].x = w2+3*c; m[5].y = h2-3*c;
+- m[6].x = w2+3*c; m[6].y = h2+5*c;
+- m[7].x = w2+1*c; m[7].y = h2+5*c;
+- m[8].x = w2+1*c; m[8].y = h2-3*c;
+- m[9].x = w2-1*c; m[9].y = h2-3*c;
+- m[10].x = w2-1*c; m[10].y = h2+5*c;
+- m[11].x = w2-3*c; m[11].y = h2+5*c;
++ /*
++ * Start 'G'.
++ */
+
+- XSetForeground(nxagentDisplay, gc, nxagentLogoRed);
+- XSetBackground(nxagentDisplay, gc, nxagentLogoWhite);
++ rect[0].x = w2+3*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+7*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+7*c; rect[2].y = h2-4*c;
++ rect[3].x = w2+3*c; rect[3].y = h2-4*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
+- XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, m, 12, Nonconvex, CoordModeOrigin);
++ rect[0].x = w2+3*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+4*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+4*c; rect[2].y = h2+3*c;
++ rect[3].x = w2+3*c; rect[3].y = h2+3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
++ rect[0].x = w2+3*c; rect[0].y = h2+2*c;
++ rect[1].x = w2+7*c; rect[1].y = h2+2*c;
++ rect[2].x = w2+7*c; rect[2].y = h2+3*c;
++ rect[3].x = w2+3*c; rect[3].y = h2+3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
++
++ rect[0].x = w2+6*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+7*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+7*c; rect[2].y = h2-3*c;
++ rect[3].x = w2+6*c; rect[3].y = h2-3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
++
++ rect[0].x = w2+6*c; rect[0].y = h2-0*c;
++ rect[1].x = w2+7*c; rect[1].y = h2-0*c;
++ rect[2].x = w2+7*c; rect[2].y = h2+3*c;
++ rect[3].x = w2+6*c; rect[3].y = h2+3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
++
++ rect[0].x = w2+5*c; rect[0].y = h2-1*c;
++ rect[1].x = w2+7*c; rect[1].y = h2-1*c;
++ rect[2].x = w2+7*c; rect[2].y = h2+0*c;
++ rect[3].x = w2+5*c; rect[3].y = h2+0*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+ /*
+- * End 'M'.
++ * End 'G'.
+ */
+
+ /*
+- * Begin '!'.
++ * Start 'O'.
+ */
+
+- rect[0].x = w2-7*c; rect[0].y = h2-5*c;
+- rect[1].x = w2-5*c; rect[1].y = h2-5*c;
+- rect[2].x = w2-5*c; rect[2].y = h2+2*c;
+- rect[3].x = w2-7*c; rect[3].y = h2+2*c;
++ rect[0].x = w2+8*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+12*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+12*c; rect[2].y = h2-4*c;
++ rect[3].x = w2+8*c; rect[3].y = h2-4*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
++ rect[0].x = w2+8*c; rect[0].y = h2+3*c;
++ rect[1].x = w2+12*c; rect[1].y = h2+3*c;
++ rect[2].x = w2+12*c; rect[2].y = h2+2*c;
++ rect[3].x = w2+8*c; rect[3].y = h2+2*c;
+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
+- rect[0].x = w2-7*c; rect[0].y = h2+3*c;
+- rect[1].x = w2-5*c; rect[1].y = h2+3*c;
+- rect[2].x = w2-5*c; rect[2].y = h2+5*c;
+- rect[3].x = w2-7*c; rect[3].y = h2+5*c;
++ rect[0].x = w2+8*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+9*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+9*c; rect[2].y = h2+3*c;
++ rect[3].x = w2+8*c; rect[3].y = h2+3*c;
++ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
++ rect[0].x = w2+11*c; rect[0].y = h2-5*c;
++ rect[1].x = w2+12*c; rect[1].y = h2-5*c;
++ rect[2].x = w2+12*c; rect[2].y = h2+3*c;
++ rect[3].x = w2+11*c; rect[3].y = h2+3*c;
+ XFillPolygon(nxagentDisplay, nxagentPixmapLogo, gc, rect, 4, Convex, CoordModeOrigin);
+
+ /*
+- * End 'M'.
++ * End 'O'.
+ */
+
++
+ XSetWindowBackgroundPixmap(nxagentDisplay, win, nxagentPixmapLogo);
+
+ #ifdef NXAGENT_LOGO_DEBUG
+--- a/nx-X11/programs/Xserver/hw/nxagent/Splash.h 2012-01-11 10:09:05.000000000 +0100
++++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.h 2012-01-11 14:48:05.000000000 +0100
+@@ -33,6 +33,7 @@ extern int nxagentLogoDepth;
+ extern int nxagentLogoWhite;
+ extern int nxagentLogoRed;
+ extern int nxagentLogoBlack;
++extern int nxagentLogoGray;
+
+ extern Window nxagentSplashWindow;
+
+--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
++++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+@@ -1754,7 +1754,20 @@
+ #ifdef TEST
+ fprintf(stderr, "nxagentOpenScreen: Created new default window with id [%ld].\n",
+ nxagentDefaultWindows[pScreen->myNum]);
++
++ 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(HINT)+1);
++ hint.res_class=malloc(strlen(HINT)+1);
++ strcpy(hint.res_name,HINT);
++ strcpy(hint.res_class,HINT);
++ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
++ free(hint.res_name);
++ free(hint.res_class);
++
+
+ if (nxagentOption(Fullscreen))
+ {
+--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h
++++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h
+@@ -36,6 +36,8 @@
+ #define MIN_NXAGENT_HEIGHT 60
+ #define NXAGENT_FRAME_WIDTH 2000
+
++#define HINT "NXAgent"
++
+ #define nxagentSetPrintGeometry(screen) \
+ nxagentPrintGeometryFlags = (1 << (screen));
+
+--- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c
++++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c
+@@ -204,6 +204,7 @@
+
+ nxagentPixmapLogo = XCreatePixmap(nxagentDisplay, win, width, height, nxagentLogoDepth);
+
++ return;
+ if (!nxagentPixmapLogo)
+ {
+ return;
+--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
++++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
+@@ -1919,7 +1919,7 @@
+ XlibPixmap IconPixmap;
+ XlibPixmap IconShape;
+
+- snprintf(default_path, PATH_MAX-1, "/usr/NX/share/images/%s", NXAGENT_ICON_NAME);
++ snprintf(default_path, PATH_MAX-1, "/usr/share/pixmaps/%s", NXAGENT_ICON_NAME);
+
+ if ((icon_fp = fopen(default_path, "r")) == NULL)
+ {