diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-08-11 09:29:17 -0400 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-08-11 09:29:17 -0400 |
commit | cbe2c0e44f412d07024207f374c0f56684adb088 (patch) | |
tree | 6bfdeb4cf99ec22f0a6fe60ff7a9e9a792105156 /nx-X11 | |
parent | 8235925a2c3599a8980ce789e0a79369118727fe (diff) | |
parent | 715fcfe6dfc2be12eb6673d2a5e5672af18f9291 (diff) | |
download | nx-libs-cbe2c0e44f412d07024207f374c0f56684adb088.tar.gz nx-libs-cbe2c0e44f412d07024207f374c0f56684adb088.tar.bz2 nx-libs-cbe2c0e44f412d07024207f374c0f56684adb088.zip |
Merge branch 'uli42-pr/versionprop' into 3.6.x
Attributes GH PR #501: https://github.com/ArcticaProject/nx-libs/pull/501
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 9 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Window.c | 16 |
3 files changed, 29 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index ee77eb64e..882dbe61b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -169,6 +169,15 @@ ProcChangeProperty(ClientPtr client) } #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, (int)mode, len, (void *)&stuff[1], TRUE); if (err != Success) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 7de25ca28..44d398304 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -134,6 +134,8 @@ extern Bool nxagentScreenTrap; WindowPtr nxagentRootTileWindow; +extern void nxagentSetVersionProperty(WindowPtr pWin); + void nxagentClearSplash(WindowPtr pW) { ScreenPtr pScreen; @@ -293,6 +295,8 @@ InitRootWindow(WindowPtr pWin) nxagentPropagateArtsdProperties(pScreen, artsd_port); } #endif + + nxagentSetVersionProperty(pWin); } /***** diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 4cefd3f16..9afef8a0c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -532,6 +532,22 @@ FIXME: Do all the windows for which nxagentWindowTopLevel(pWin) 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() { WindowPtr pWin = screenInfo.screens[0]->root -> firstChild; |