aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Atoms.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c16
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c19
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmap.c16
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Reconnect.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Render.c12
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c20
9 files changed, 45 insertions, 52 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
index 1e9a4bd37..c36c38e2f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
@@ -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();
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index 3ca3db2a3..448969d44 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
@@ -2492,12 +2492,10 @@ static int nxagentInitAndCheckVisuals(int flexibility)
long viMask;
int i, n;
- int matched;
- int compatible;
+ bool matched;
+ bool compatible = true;
int viNumList;
- compatible = 1;
-
viMask = VisualScreenMask;
viTemplate.screen = DefaultScreen(nxagentDisplay);
viTemplate.depth = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay));
@@ -2507,7 +2505,7 @@ static int nxagentInitAndCheckVisuals(int flexibility)
for (i = 0; i < nxagentNumVisuals; i++)
{
- matched = 0;
+ matched = false;
for (n = 0; n < viNumList; n++)
{
@@ -2528,7 +2526,7 @@ FIXME: Should the visual be ignored in this case?
#endif
}
- matched = 1;
+ matched = true;
nxagentVisualHasBeenIgnored[i] = FALSE;
@@ -2538,7 +2536,7 @@ FIXME: Should the visual be ignored in this case?
}
}
- if (matched == 0)
+ if (!matched)
{
if (nxagentVisuals[i].class == DirectColor)
{
@@ -2564,7 +2562,7 @@ FIXME: Should the visual be ignored in this case?
fprintf(stderr, "\tbits_per_rgb = %d\n", nxagentVisuals[i].bits_per_rgb);
#endif
- compatible = 0;
+ compatible = false;
break;
}
@@ -2573,7 +2571,7 @@ FIXME: Should the visual be ignored in this case?
XFree(viList);
- if (compatible == 1)
+ if (compatible)
{
#ifdef TEST
fprintf(stderr, "nxagentInitAndCheckVisuals: New visuals match with old visuals.\n");
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 071e93b32..94480c45c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -373,7 +373,7 @@ void nxagentRemoteWindowID(Window window, Bool newline)
}
}
- if (newline == TRUE)
+ if (newline)
{
fprintf(stderr, "\n");
}
@@ -411,7 +411,7 @@ void nxagentRemoteWindowInfo(Window win, int indent, Bool newLine)
(attributes.override_redirect == 0) ?
"No" : "Yes" );
- if (newLine == TRUE)
+ if (newLine)
{
fprintf(stderr, "\n");
}
@@ -537,7 +537,7 @@ void nxagentInternalWindowInfo(WindowPtr pWin, int indent, Bool newLine)
(pWin -> overrideRedirect == 0) ?
"No" : "Yes");
- if (newLine == TRUE)
+ if (newLine)
{
fprintf(stderr, "\n");
}
@@ -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;
@@ -4061,8 +4061,7 @@ void nxagentHandleCollectPropertyEvent(XEvent *X)
nxagentImportProperty(window, property, atomReturnType, resultFormat,
ulReturnItems, ulReturnBytesLeft, pszReturnData);
}
-
- if (result == 0)
+ else
{
#ifdef DEBUG
fprintf (stderr, "nxagentHandleCollectPropertyEvent: Failed to get reply data for client [%d].\n",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index 5cfa92769..22d5f191e 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -142,7 +142,7 @@ void nxagentWaitDisplay(void);
void nxagentListRemoteFonts(const char *, int);
unsigned int nxagentWMtimeout = 0;
-Bool nxagentWMPassed = 0;
+Bool nxagentWMPassed = False;
/*
* Timeouts based on screen saver time.
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
index 421e023c1..be154f9c2 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
@@ -860,10 +860,10 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2)
Bool *pBool = (Bool*) p2;
nxagentPrivPixmapPtr pPixmapPriv;
- if (*pBool == 0 || pPixmap == NULL ||
+ if (!*pBool || pPixmap == NULL ||
NXDisplayError(nxagentDisplay) == 1)
{
- *pBool = 0;
+ *pBool = False;
#ifdef TEST
fprintf(stderr, "nxagentReconnectPixmap: Ignoring pixmap at [%p] while "
@@ -929,7 +929,7 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2)
nxagentSplitTrap = 0;
- if (*pBool == 0)
+ if (!*pBool)
{
#ifdef PANIC
fprintf(stderr, "nxagentReconnectPixmap: PANIC! Failed to synchronize the pixmap.\n");
@@ -1035,7 +1035,7 @@ static void nxagentCheckOnePixmapIntegrity(void *p0, XID x1, void *p2)
PixmapPtr pPixmap = (PixmapPtr) p0;
Bool *pBool = (Bool*) p2;
- if (*pBool == False)
+ if (!*pBool)
{
return;
}
@@ -1065,7 +1065,7 @@ static void nxagentCheckOnePixmapIntegrity(void *p0, XID x1, void *p2)
Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
{
- Bool integrity = 1;
+ Bool integrity = True;
XImage *image;
char *data;
int format;
@@ -1121,11 +1121,11 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
if (image != NULL && memcmp(image -> data, data, length) != 0)
{
- integrity = 0;
+ integrity = False;
}
else
{
- integrity = 1;
+ integrity = True;
#ifdef TEST
fprintf(stderr, "nxagentCheckPixmapIntegrity: Pixmap at [%p] has been realized. "
@@ -1135,7 +1135,7 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
#ifdef WARNING
- if (integrity == 0)
+ if (!integrity)
{
int i;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
index 9a6cbf28b..6d15f2021 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
@@ -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",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
index b58a16f3d..9d91b1ff1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c
@@ -2784,7 +2784,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2)
Bool nxagentReconnectAllGlyphSet(void *p)
{
- Bool success = TRUE;
+ Bool success = True;
int i;
nxagentQueryFormats();
@@ -2826,7 +2826,7 @@ void nxagentReconnectPicture(void * p0, XID x1, void *p2)
* and that the involved objects are valid.
*/
- if (*pBool == 0 || pPicture == NULL ||
+ if (!*pBool || pPicture == NULL ||
nxagentPicture(pPicture) != 0)
{
return;
@@ -2959,7 +2959,7 @@ Bool nxagentReconnectAllPicture(void *p)
fprintf(stderr, "nxagentReconnectAllPicture: Going to recreate all pictures.\n");
#endif
- for (i = 0, r = 1; i < MAXCLIENTS; i++)
+ for (i = 0, r = True; i < MAXCLIENTS; i++)
{
if (clients[i])
{
@@ -2967,7 +2967,7 @@ Bool nxagentReconnectAllPicture(void *p)
#ifdef WARNING
- if (r == False)
+ if (!r)
{
fprintf(stderr, "nxagentReconnectAllPicture: WARNING! Failed to recreate "
"picture for client [%d].\n", i);
@@ -3015,7 +3015,7 @@ Bool nxagentDisconnectAllPicture(void)
fprintf(stderr, "nxagentDisconnectAllPicture.\n");
#endif
- for (i = 0, r = 1; i < MAXCLIENTS; i++)
+ for (i = 0, r = True; i < MAXCLIENTS; i++)
{
if (clients[i])
{
@@ -3023,7 +3023,7 @@ Bool nxagentDisconnectAllPicture(void)
#ifdef WARNING
- if (r == False)
+ if (!r)
{
fprintf(stderr, "nxagentDisconnectAllPicture: WARNING! Failed to disconnect "
"picture for client [%d].\n", i);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index b5aabf8bd..d8cf695a0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -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");
@@ -3057,7 +3057,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
if (result == 1)
{
- if (nxagentWMPassed == 0)
+ if (!nxagentWMPassed)
{
nxagentRemoveSplashWindow(NULL);
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index 5373d4889..d25424d7c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -310,7 +310,7 @@ Bool nxagentCreateWindow(pWin)
/*
FIXME: We need to set save under on the real display?
*/
- if (nxagentSaveUnder == True)
+ if (nxagentSaveUnder)
{
mask |= CWSaveUnder;
attributes.save_under = False;
@@ -749,7 +749,7 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
return;
}
- if (switchOn == 0)
+ if (!switchOn)
{
nxagentWMDetect();
@@ -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 "
@@ -793,7 +793,7 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
XSendEvent(nxagentDisplay, DefaultRootWindow(nxagentDisplay), False,
SubstructureRedirectMask, &e);
- if (switchOn == 1)
+ if (switchOn)
{
nxagentFullscreenWindow = nxagentDefaultWindows[pScreen -> myNum];
@@ -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);
}
@@ -2683,7 +2683,7 @@ void nxagentDisconnectWindow(void * p0, XID x1, void * p2)
nxagentDisconnectCursor(pCursor, (XID)0, pBool);
- if (*pBool == False)
+ if (!*pBool)
{
#ifdef WARNING
fprintf(stderr, "nxagentDisconnectWindow: WARNING failed disconnection of cursor at [%p]"
@@ -2725,8 +2725,6 @@ Bool nxagentReconnectAllWindows(void *p0)
{
int flexibility = *(int *) p0;
- flexibility = flexibility;
-
#if defined(NXAGENT_RECONNECT_DEBUG) || defined(NXAGENT_RECONNECT_WINDOW_DEBUG)
fprintf(stderr, "nxagentReconnectAllWindows\n");
#endif
@@ -2845,8 +2843,6 @@ Bool nxagentSetWindowCursors(void *p0)
{
int flexibility = *(int *) p0;
- flexibility = flexibility;
-
#if defined(NXAGENT_RECONNECT_DEBUG) || defined(NXAGENT_RECONNECT_WINDOW_DEBUG)
fprintf(stderr, "nxagentSetWindowCursors: Going to loop over the windows.\n");
#endif
@@ -2937,7 +2933,7 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
/*
FIXME: Do we need to set save unders attribute here?
*/
- if (nxagentSaveUnder == True)
+ if (nxagentSaveUnder)
{
mask |= CWSaveUnder;
attributes.save_under = pWin->saveUnder;