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)
X -> request_code == X_ChangeWindowAttributes &&
X -> resourceid == DefaultRootWindow(dpy))
{
nxagentWMIsRunning = TRUE;
nxagentWMIsRunning = True;
}
else
{
......@@ -122,7 +122,7 @@ static void startWMDetection(void)
* window.
*/
nxagentWMIsRunning = FALSE;
nxagentWMIsRunning = False;
previousErrorHandler = XSetErrorHandler((XErrorHandler)&catchAndRedirect);
......@@ -166,7 +166,7 @@ static void finishWMDetection(Bool verbose)
void nxagentWMDetect()
{
Bool verbose = False;
int windowManagerWasRunning = nxagentWMIsRunning;
Bool windowManagerWasRunning = nxagentWMIsRunning;
startWMDetection();
......
......@@ -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
* the nxagent window gets mapped.
*/
if (nxagentWMIsRunning == 0 &&
if (!nxagentWMIsRunning &&
X.xmap.window == nxagentDefaultWindows[nxagentScreen(X.xmap.window)->myNum])
{
nxagentChangeScreenConfig(nxagentScreen(X.xmap.window)->myNum, nxagentOption(Width),
......@@ -2767,7 +2767,7 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
if (X -> xclient.window == (nxagentOption(Fullscreen) ?
nxagentIconWindow : nxagentDefaultWindows[0]) ||
nxagentWMIsRunning == 0)
!nxagentWMIsRunning)
{
*result = doCloseSession;
}
......@@ -3353,7 +3353,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
* by the window manager are relevant, see ICCCM Chapter 4,
* "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 newY = X -> xconfigure.y;
......@@ -3395,7 +3395,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
count++;
#endif
if (nxagentWMIsRunning == 0 || X -> xconfigure.send_event)
if (!nxagentWMIsRunning || X -> xconfigure.send_event)
{
updatePos = True;
newX = X -> xconfigure.x;
......@@ -3626,7 +3626,7 @@ int nxagentHandleReparentNotify(XEvent* X)
return 1;
}
else if (nxagentWMIsRunning == 1 && nxagentOption(Fullscreen) == 0 &&
else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 &&
nxagentOption(WMBorderWidth) == -1)
{
XlibWindow w;
......
......@@ -402,7 +402,7 @@ void nxagentDisconnectSession(void)
nxagentDisconnectAllGCs();
nxagentDisconnectDisplay();
nxagentWMIsRunning = 0;
nxagentWMIsRunning = False;
#ifdef TEST
fprintf(stderr, "nxagentDisconnectSession: Disconnection completed. SigHup is [%d]. IoError is [%d].\n",
......
......@@ -977,7 +977,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* fullscreen mode.
*/
if (nxagentOption(Rootless) == False && nxagentWMIsRunning == False)
if (nxagentOption(Rootless) == False && !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n");
......
......@@ -762,7 +762,7 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
isItTimeToYield = 1;
if (nxagentWMIsRunning == 0)
if (!nxagentWMIsRunning)
{
#ifdef WARNING
fprintf(stderr, "Warning: Can't switch to window mode, no window manager "
......@@ -2552,7 +2552,7 @@ void nxagentMapDefaultWindows(void)
* Windows client.
*/
if (nxagentOption(Shadow) == 0 || nxagentWMIsRunning == 0)
if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
......@@ -2561,7 +2561,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning == 1)
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning)
{
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