aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Window.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-01-17 12:06:34 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-01-17 12:06:34 +0100
commitca8236e7fe565e851362a744bfa0312274e1f856 (patch)
tree15698731b348375873fcbbb18002da57d8f53f6b /nx-X11/programs/Xserver/hw/nxagent/Window.c
parent4214a719a0c0564e7c4ced565e0a28ecdcc7f2d7 (diff)
parentd16a5fbb19c072b667be76633bc3f23f12ca82ef (diff)
downloadnx-libs-ca8236e7fe565e851362a744bfa0312274e1f856.tar.gz
nx-libs-ca8236e7fe565e851362a744bfa0312274e1f856.tar.bz2
nx-libs-ca8236e7fe565e851362a744bfa0312274e1f856.zip
Merge branch 'uli42-pr/window_fixes' into 3.6.x
Attributes GH PR #761: https://github.com/ArcticaProject/nx-libs/pull/761
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Window.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index 82f4991c3..c404d0a46 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -1822,6 +1822,18 @@ Bool nxagentChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
return 1;
}
+void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
+{
+ Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True);
+ nxagentWMStateRec wmState = {.state = desired, .icon = None};
+ if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success)
+ {
+ #ifdef WARNING
+ fprintf(stderr, "%s: Changing WM_STATE failed.\n", __func__);
+ #endif
+ }
+}
+
Bool nxagentRealizeWindow(WindowPtr pWin)
{
if (nxagentScreenTrap == 1)
@@ -1843,14 +1855,7 @@ Bool nxagentRealizeWindow(WindowPtr pWin)
/* add by dimbor */
if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin))
{
- Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True);
- nxagentWMStateRec wmState;
- wmState.state = 1; /* NormalState */
- wmState.icon = None;
- if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success)
- {
- fprintf(stderr, "nxagentRealizeWindow: Adding WM_STATE fail.\n");
- }
+ nxagentSetWMState(pWin, NormalState);
}
/*
@@ -1878,7 +1883,7 @@ Bool nxagentRealizeWindow(WindowPtr pWin)
#ifdef TEST
if (nxagentOption(Rootless) && nxagentLastWindowDestroyed)
{
- fprintf(stderr, "nxagentRealizeWindow: Window realized. Stopped termination for rootless session.\n");
+ fprintf(stderr, "%s: Window realized. Stopped termination for rootless session.\n", __func__);
}
#endif
@@ -1899,14 +1904,11 @@ Bool nxagentUnrealizeWindow(WindowPtr pWin)
/* add by dimbor */
if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin))
{
- Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True);
- nxagentWMStateRec wmState;
- wmState.state = 3; /* WithdrawnState */
- wmState.icon = None;
- if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success)
- {
- fprintf(stderr, "nxagentUnRealizeWindow: Changing WM_STATE failed.\n");
- }
+ /*
+ * The original _comment_ was WithdrawnState, while the _value_
+ * was 3, which is IconicState.
+ */
+ nxagentSetWMState(pWin, IconicState);
}
XUnmapWindow(nxagentDisplay, nxagentWindow(pWin));