Commit 6b2033bd authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: use nxagentWMIsRunning as Bool all over the place

has been used as integer sometimes (technically correct, but not nice) Fixes ArcticaProject/nx-libs#698
parent c478ba29
...@@ -106,7 +106,7 @@ static void catchAndRedirect(Display* dpy, XErrorEvent* X) ...@@ -106,7 +106,7 @@ static void catchAndRedirect(Display* dpy, XErrorEvent* X)
X -> request_code == X_ChangeWindowAttributes && X -> request_code == X_ChangeWindowAttributes &&
X -> resourceid == DefaultRootWindow(dpy)) X -> resourceid == DefaultRootWindow(dpy))
{ {
nxagentWMIsRunning = TRUE; nxagentWMIsRunning = True;
} }
else else
{ {
...@@ -122,7 +122,7 @@ static void startWMDetection(void) ...@@ -122,7 +122,7 @@ static void startWMDetection(void)
* window. * window.
*/ */
nxagentWMIsRunning = FALSE; nxagentWMIsRunning = False;
previousErrorHandler = XSetErrorHandler((XErrorHandler)&catchAndRedirect); previousErrorHandler = XSetErrorHandler((XErrorHandler)&catchAndRedirect);
...@@ -166,7 +166,7 @@ static void finishWMDetection(Bool verbose) ...@@ -166,7 +166,7 @@ static void finishWMDetection(Bool verbose)
void nxagentWMDetect() void nxagentWMDetect()
{ {
Bool verbose = False; Bool verbose = False;
int windowManagerWasRunning = nxagentWMIsRunning; Bool windowManagerWasRunning = nxagentWMIsRunning;
startWMDetection(); startWMDetection();
......
...@@ -2046,7 +2046,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was ...@@ -2046,7 +2046,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
* event that would trigger xinerama updates. So we do that once * event that would trigger xinerama updates. So we do that once
* the nxagent window gets mapped. * the nxagent window gets mapped.
*/ */
if (nxagentWMIsRunning == 0 && if (!nxagentWMIsRunning &&
X.xmap.window == nxagentDefaultWindows[nxagentScreen(X.xmap.window)->myNum]) X.xmap.window == nxagentDefaultWindows[nxagentScreen(X.xmap.window)->myNum])
{ {
nxagentChangeScreenConfig(nxagentScreen(X.xmap.window)->myNum, nxagentOption(Width), nxagentChangeScreenConfig(nxagentScreen(X.xmap.window)->myNum, nxagentOption(Width),
...@@ -2767,7 +2767,7 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) ...@@ -2767,7 +2767,7 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
if (X -> xclient.window == (nxagentOption(Fullscreen) ? if (X -> xclient.window == (nxagentOption(Fullscreen) ?
nxagentIconWindow : nxagentDefaultWindows[0]) || nxagentIconWindow : nxagentDefaultWindows[0]) ||
nxagentWMIsRunning == 0) !nxagentWMIsRunning)
{ {
*result = doCloseSession; *result = doCloseSession;
} }
...@@ -3353,7 +3353,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3353,7 +3353,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
* by the window manager are relevant, see ICCCM Chapter 4, * by the window manager are relevant, see ICCCM Chapter 4,
* "Configuring the Window" * "Configuring the Window"
*/ */
Bool updatePos = (nxagentWMIsRunning == 0 || X -> xconfigure.send_event != 0); Bool updatePos = (!nxagentWMIsRunning || X -> xconfigure.send_event != 0);
int newX = X -> xconfigure.x; int newX = X -> xconfigure.x;
int newY = X -> xconfigure.y; int newY = X -> xconfigure.y;
...@@ -3395,7 +3395,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3395,7 +3395,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
count++; count++;
#endif #endif
if (nxagentWMIsRunning == 0 || X -> xconfigure.send_event) if (!nxagentWMIsRunning || X -> xconfigure.send_event)
{ {
updatePos = True; updatePos = True;
newX = X -> xconfigure.x; newX = X -> xconfigure.x;
...@@ -3626,7 +3626,7 @@ int nxagentHandleReparentNotify(XEvent* X) ...@@ -3626,7 +3626,7 @@ int nxagentHandleReparentNotify(XEvent* X)
return 1; return 1;
} }
else if (nxagentWMIsRunning == 1 && nxagentOption(Fullscreen) == 0 && else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 &&
nxagentOption(WMBorderWidth) == -1) nxagentOption(WMBorderWidth) == -1)
{ {
XlibWindow w; XlibWindow w;
......
...@@ -402,7 +402,7 @@ void nxagentDisconnectSession(void) ...@@ -402,7 +402,7 @@ void nxagentDisconnectSession(void)
nxagentDisconnectAllGCs(); nxagentDisconnectAllGCs();
nxagentDisconnectDisplay(); nxagentDisconnectDisplay();
nxagentWMIsRunning = 0; nxagentWMIsRunning = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDisconnectSession: Disconnection completed. SigHup is [%d]. IoError is [%d].\n", fprintf(stderr, "nxagentDisconnectSession: Disconnection completed. SigHup is [%d]. IoError is [%d].\n",
......
...@@ -977,7 +977,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -977,7 +977,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* fullscreen mode. * fullscreen mode.
*/ */
if (nxagentOption(Rootless) == False && nxagentWMIsRunning == False) if (nxagentOption(Rootless) == False && !nxagentWMIsRunning)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n"); fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n");
......
...@@ -762,7 +762,7 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) ...@@ -762,7 +762,7 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
isItTimeToYield = 1; isItTimeToYield = 1;
if (nxagentWMIsRunning == 0) if (!nxagentWMIsRunning)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "Warning: Can't switch to window mode, no window manager " fprintf(stderr, "Warning: Can't switch to window mode, no window manager "
...@@ -2552,7 +2552,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2552,7 +2552,7 @@ void nxagentMapDefaultWindows(void)
* Windows client. * Windows client.
*/ */
if (nxagentOption(Shadow) == 0 || nxagentWMIsRunning == 0) if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n", fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
...@@ -2561,7 +2561,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2561,7 +2561,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning == 1) if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning)
{ {
nxagentMaximizeToFullScreen(pScreen); nxagentMaximizeToFullScreen(pScreen);
} }
......
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