Commit 715fcfe6 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Set NX_AGENT_VERSION property for root window

Fixes ArcticaProject/nx-libs#500
parent 8235925a
...@@ -169,6 +169,15 @@ ProcChangeProperty(ClientPtr client) ...@@ -169,6 +169,15 @@ ProcChangeProperty(ClientPtr client)
} }
#endif #endif
#ifdef NXAGENT_SERVER
/* prevent clients from changing the NX_AGENT_VERSION property */
{
Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True);
if (stuff->property == prop)
return client->noClientException;
}
#endif
err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format,
(int)mode, len, (void *)&stuff[1], TRUE); (int)mode, len, (void *)&stuff[1], TRUE);
if (err != Success) if (err != Success)
......
...@@ -134,6 +134,8 @@ extern Bool nxagentScreenTrap; ...@@ -134,6 +134,8 @@ extern Bool nxagentScreenTrap;
WindowPtr nxagentRootTileWindow; WindowPtr nxagentRootTileWindow;
extern void nxagentSetVersionProperty(WindowPtr pWin);
void nxagentClearSplash(WindowPtr pW) void nxagentClearSplash(WindowPtr pW)
{ {
ScreenPtr pScreen; ScreenPtr pScreen;
...@@ -293,6 +295,8 @@ InitRootWindow(WindowPtr pWin) ...@@ -293,6 +295,8 @@ InitRootWindow(WindowPtr pWin)
nxagentPropagateArtsdProperties(pScreen, artsd_port); nxagentPropagateArtsdProperties(pScreen, artsd_port);
} }
#endif #endif
nxagentSetVersionProperty(pWin);
} }
/***** /*****
......
...@@ -532,6 +532,22 @@ FIXME: Do all the windows for which nxagentWindowTopLevel(pWin) ...@@ -532,6 +532,22 @@ FIXME: Do all the windows for which nxagentWindowTopLevel(pWin)
return True; return True;
} }
/* set the NX_AGENT_VERSION property for the given window (normally
the root window) */
void nxagentSetVersionProperty(WindowPtr pWin)
{
char *name = "NX_AGENT_VERSION";
Atom prop = MakeAtom(name, strlen(name), True);
if (ChangeWindowProperty(pWin, prop, XA_STRING, 8, PropModeReplace, strlen(NX_VERSION_CURRENT_STRING), NX_VERSION_CURRENT_STRING, True) != Success)
fprintf(stderr, "%s: Adding propery [%s], value [%s] failed.\n", __func__, name, NX_VERSION_CURRENT_STRING);
#ifdef DEBUG
else
fprintf(stderr, "%s: Added property [%s], value [%s] for root window [%x].\n", __func__, name, NX_VERSION_CURRENT_STRING, pWin);
#endif
}
Bool nxagentSomeWindowsAreMapped() Bool nxagentSomeWindowsAreMapped()
{ {
WindowPtr pWin = screenInfo.screens[0]->root -> firstChild; WindowPtr pWin = screenInfo.screens[0]->root -> firstChild;
......
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