Commit 6aa18cc2 authored by Oleksandr Shneyder's avatar Oleksandr Shneyder Committed by Mike Gabriel

X2Go icon when run with x2goagent flavour…

X2Go icon when run with x2goagent flavour (201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch). Depending on the binary name of the agent either nxagent.xpm or x2go.xpm is used as window icon.
parent 1681f111
201_nxagent_set-x2go-icon-if-x2goagent-flavour.full.patch
202_nx-X11_enable-xinerama.full.patch 202_nx-X11_enable-xinerama.full.patch
203_nxagent_disable-rootless-exit.full.patch 203_nxagent_disable-rootless-exit.full.patch
204_nxagent_repaint-solidpict.full.patch 204_nxagent_repaint-solidpict.full.patch
......
...@@ -77,6 +77,7 @@ is" without express or implied warranty. ...@@ -77,6 +77,7 @@ is" without express or implied warranty.
#include "NXlib.h" #include "NXlib.h"
#include NXAGENT_ICON_NAME #include NXAGENT_ICON_NAME
#include X2GOAGENT_ICON_NAME
/* /*
* Set here the required log level. * Set here the required log level.
...@@ -1941,12 +1942,29 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask) ...@@ -1941,12 +1942,29 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
Bool success = False; Bool success = False;
XlibPixmap IconPixmap; XlibPixmap IconPixmap;
XlibPixmap IconShape; 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) 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) if (icon_fp != NULL)
{ {
...@@ -1985,7 +2003,7 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask) ...@@ -1985,7 +2003,7 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
{ {
status = XpmCreatePixmapFromData(display, status = XpmCreatePixmapFromData(display,
DefaultRootWindow(display), DefaultRootWindow(display),
nxagentIconData, agentIconData,
&IconPixmap, &IconPixmap,
&IconShape, &IconShape,
NULL); NULL);
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#define NXAGENT_ICON_NAME "nxagent.xpm" #define NXAGENT_ICON_NAME "nxagent.xpm"
#define X2GOAGENT_ICON_NAME "x2go.xpm"
#define NXAGENT_PLACEHOLDER_NAME "nxmissing.xpm" #define NXAGENT_PLACEHOLDER_NAME "nxmissing.xpm"
#endif /* __Icons_H__ */ #endif /* __Icons_H__ */
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