Commit 16cd2bbe authored by Ulrich Sibiller's avatar Ulrich Sibiller

nxagent: rework Bool handling

drop "== False", "== 0", "== True" and "== 0" for nxagentOptions and Traps
parent 5bbab001
...@@ -522,7 +522,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -522,7 +522,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
sscanf(argv[i], "%i", &level) == 1 && sscanf(argv[i], "%i", &level) == 1 &&
level >= 0 && level <= 2) level >= 0 && level <= 2)
{ {
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeOption(DeferLevel, level); nxagentChangeOption(DeferLevel, level);
...@@ -624,7 +624,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -624,7 +624,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
} }
} }
if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen) == 1)) return 2; if (nxagentUserGeometry.flag || nxagentOption(Fullscreen)) return 2;
} }
return 0; return 0;
...@@ -1122,7 +1122,7 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1122,7 +1122,7 @@ static void nxagentParseSingleOption(char *name, char *value)
} }
else if (!strcmp(name, "render")) else if (!strcmp(name, "render"))
{ {
if (nxagentReconnectTrap == True) if (nxagentReconnectTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n"); fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n");
...@@ -1154,7 +1154,7 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1154,7 +1154,7 @@ static void nxagentParseSingleOption(char *name, char *value)
} }
else if (!strcmp(name, "fullscreen")) else if (!strcmp(name, "fullscreen"))
{ {
if (nxagentReconnectTrap == True) if (nxagentReconnectTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n"); fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n");
...@@ -1267,13 +1267,13 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1267,13 +1267,13 @@ static void nxagentParseSingleOption(char *name, char *value)
} }
else if (!strcmp(name, "resize")) else if (!strcmp(name, "resize"))
{ {
if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0) if (!nxagentOption(DesktopResize) || strcmp(value, "0") == 0)
{ {
nxagentResizeDesktopAtStartup = 0; nxagentResizeDesktopAtStartup = False;
} }
else if (strcmp(value, "1") == 0) else if (strcmp(value, "1") == 0)
{ {
nxagentResizeDesktopAtStartup = 1; nxagentResizeDesktopAtStartup = True;
} }
else else
{ {
...@@ -1324,7 +1324,7 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1324,7 +1324,7 @@ static void nxagentParseSingleOption(char *name, char *value)
} }
else if (!strcmp(name, "autodpi")) else if (!strcmp(name, "autodpi"))
{ {
if (nxagentReconnectTrap == True) if (nxagentReconnectTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n"); fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n");
...@@ -1793,7 +1793,7 @@ N/A ...@@ -1793,7 +1793,7 @@ N/A
#endif #endif
if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1) if (nxagentOption(Rootless) && nxagentOption(Fullscreen))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n");
...@@ -2092,7 +2092,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2092,7 +2092,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
nxagentAlphaEnabled = False; nxagentAlphaEnabled = False;
} }
if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp)) if (nxagentOption(Rootless) && nxagentOption(Xdmcp))
{ {
FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n");
} }
...@@ -2102,7 +2102,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2102,7 +2102,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
* XDMCP sessions. * XDMCP sessions.
*/ */
if (nxagentOption(Reset) == True && nxagentMaxAllowedResets == 0) if (nxagentOption(Reset) && nxagentMaxAllowedResets == 0)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n"); fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n");
...@@ -2119,7 +2119,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2119,7 +2119,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
* to a standard XFree86 server. * to a standard XFree86 server.
*/ */
if (nxagentOption(Reset) == False) if (!nxagentOption(Reset))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPostProcessArgs: Disabling dispatch of exception at server reset.\n"); fprintf(stderr, "nxagentPostProcessArgs: Disabling dispatch of exception at server reset.\n");
...@@ -2399,7 +2399,7 @@ void nxagentSetDeferLevel(void) ...@@ -2399,7 +2399,7 @@ void nxagentSetDeferLevel(void)
* of the agent. * of the agent.
*/ */
if (nxagentOption(Streaming) == 1) if (nxagentOption(Streaming))
{ {
fprintf(stderr, "Warning: Streaming of images not available in this agent.\n"); fprintf(stderr, "Warning: Streaming of images not available in this agent.\n");
...@@ -2484,7 +2484,7 @@ void nxagentSetDeferLevel(void) ...@@ -2484,7 +2484,7 @@ void nxagentSetDeferLevel(void)
* Set the defer timeout. * Set the defer timeout.
*/ */
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n"); fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n");
...@@ -2499,7 +2499,7 @@ void nxagentSetDeferLevel(void) ...@@ -2499,7 +2499,7 @@ void nxagentSetDeferLevel(void)
* Set the defer level. * Set the defer level.
*/ */
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow) )
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n"); fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n");
...@@ -2631,7 +2631,7 @@ void nxagentSetScheduler(void) ...@@ -2631,7 +2631,7 @@ void nxagentSetScheduler(void)
* The smart scheduler is the default. * The smart scheduler is the default.
*/ */
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n"); fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n");
......
...@@ -59,7 +59,7 @@ void nxagentCompositeExtensionInit(void) ...@@ -59,7 +59,7 @@ void nxagentCompositeExtensionInit(void)
nxagentCompositeEnable = 0; nxagentCompositeEnable = 0;
if (nxagentOption(Composite) == 1) if (nxagentOption(Composite))
{ {
int eventBase, errorBase; int eventBase, errorBase;
...@@ -119,7 +119,7 @@ void nxagentRedirectDefaultWindows(void) ...@@ -119,7 +119,7 @@ void nxagentRedirectDefaultWindows(void)
{ {
int i; int i;
if (nxagentOption(Rootless) == 1 || if (nxagentOption(Rootless) ||
nxagentCompositeEnable == 0) nxagentCompositeEnable == 0)
{ {
#ifdef TEST #ifdef TEST
...@@ -159,7 +159,7 @@ void nxagentRedirectDefaultWindows(void) ...@@ -159,7 +159,7 @@ void nxagentRedirectDefaultWindows(void)
void nxagentRedirectWindow(WindowPtr pWin) void nxagentRedirectWindow(WindowPtr pWin)
{ {
if (nxagentOption(Rootless) == 0 || if (!nxagentOption(Rootless) ||
nxagentCompositeEnable == 0) nxagentCompositeEnable == 0)
{ {
#ifdef TEST #ifdef TEST
......
...@@ -134,7 +134,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -134,7 +134,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None; cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None;
if (nxagentOption(Rootless) == False) if (!nxagentOption(Rootless))
{ {
XDefineCursor(nxagentDisplay, XDefineCursor(nxagentDisplay,
nxagentInputWindows[pScreen -> myNum], nxagentInputWindows[pScreen -> myNum],
......
...@@ -313,7 +313,7 @@ static void nxagentSighupHandler(int signal) ...@@ -313,7 +313,7 @@ static void nxagentSighupHandler(int signal)
} }
else if (nxagentSessionState == SESSION_UP) else if (nxagentSessionState == SESSION_UP)
{ {
if (nxagentOption(Persistent) == 1) if (nxagentOption(Persistent))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n"); fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n");
......
...@@ -148,7 +148,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre ...@@ -148,7 +148,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre
pDrawable = nxagentSplitDrawable(pDrawable); pDrawable = nxagentSplitDrawable(pDrawable);
if (nxagentLosslessTrap == 0) if (!nxagentLosslessTrap)
{ {
if (nxagentDrawableStatus(pDrawable) == Synchronized) if (nxagentDrawableStatus(pDrawable) == Synchronized)
{ {
...@@ -171,15 +171,15 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre ...@@ -171,15 +171,15 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre
* transferred in a single operation. * transferred in a single operation.
*/ */
nxagentFBTrap = 1; nxagentFBTrap = True;
nxagentSplitTrap = 1; nxagentSplitTrap = True;
result = nxagentSynchronizeDrawableData(pDrawable, breakMask, owner); result = nxagentSynchronizeDrawableData(pDrawable, breakMask, owner);
nxagentSplitTrap = 0; nxagentSplitTrap = False;
nxagentFBTrap = 0; nxagentFBTrap = False;
if (wait == DO_WAIT && nxagentSplitResource(pDrawable) != NULL) if (wait == DO_WAIT && nxagentSplitResource(pDrawable) != NULL)
{ {
...@@ -253,7 +253,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask ...@@ -253,7 +253,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
* compression turned off. * compression turned off.
*/ */
if (nxagentLosslessTrap == 1) if (nxagentLosslessTrap)
{ {
pGC = nxagentGetGraphicContext(pDrawable); pGC = nxagentGetGraphicContext(pDrawable);
...@@ -285,7 +285,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask ...@@ -285,7 +285,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
goto nxagentSynchronizeDrawableDataEnd; goto nxagentSynchronizeDrawableDataEnd;
} }
else if (nxagentReconnectTrap == 1) else if (nxagentReconnectTrap)
{ {
/* /*
* The pixmap data is not synchronized unless * The pixmap data is not synchronized unless
...@@ -298,7 +298,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask ...@@ -298,7 +298,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
{ {
#ifdef TEST #ifdef TEST
if (nxagentReconnectTrap == 1) if (nxagentReconnectTrap)
{ {
static int totalLength; static int totalLength;
static int totalReconnectedPixmaps; static int totalReconnectedPixmaps;
...@@ -586,11 +586,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -586,11 +586,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
saveTrap = nxagentGCTrap; saveTrap = nxagentGCTrap;
nxagentGCTrap = 0; nxagentGCTrap = False;
nxagentFBTrap = 1; nxagentFBTrap = True;
nxagentSplitTrap = 1; nxagentSplitTrap = True;
pGC = nxagentGetGraphicContext(pDrawable); pGC = nxagentGetGraphicContext(pDrawable);
...@@ -894,7 +894,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -894,7 +894,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (owner != NULL) if (owner != NULL)
{ {
if (nxagentOption(Shadow) == 1 && if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE || (nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE)) nxagentOption(YRatio) != DONT_SCALE))
{ {
...@@ -945,15 +945,15 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -945,15 +945,15 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentSynchronizeRegionStop: nxagentSynchronizeRegionStop:
nxagentSplitTrap = 0; nxagentSplitTrap = False;
nxagentFBTrap = 0; nxagentFBTrap = False;
nxagentGCTrap = saveTrap; nxagentGCTrap = saveTrap;
success = 1; success = 1;
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
if (nxagentSynchronization.abort == 1) if (nxagentSynchronization.abort == 1)
{ {
...@@ -1025,7 +1025,7 @@ nxagentSynchronizeRegionStop: ...@@ -1025,7 +1025,7 @@ nxagentSynchronizeRegionStop:
w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1;
h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1;
if (nxagentOption(Shadow) == 1 && if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE || (nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE)) nxagentOption(YRatio) != DONT_SCALE))
{ {
...@@ -2633,7 +2633,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) ...@@ -2633,7 +2633,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
saveTrap = nxagentGCTrap; saveTrap = nxagentGCTrap;
nxagentGCTrap = 1; nxagentGCTrap = True;
if (nxagentDrawableStatus(pDrawable) == Synchronized) if (nxagentDrawableStatus(pDrawable) == Synchronized)
{ {
......
...@@ -396,7 +396,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -396,7 +396,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
{ {
if (width == 0) if (width == 0)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
} }
...@@ -408,7 +408,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -408,7 +408,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
if (height == 0) if (height == 0)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
} }
...@@ -420,7 +420,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -420,7 +420,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width, XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width,
height); height);
...@@ -434,8 +434,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -434,8 +434,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
UpdateCurrentTime(); UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 && if (nxagentOption(DesktopResize) &&
(nxagentOption(Fullscreen) == 1 || (nxagentOption(Fullscreen) ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
{ {
...@@ -446,8 +446,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -446,8 +446,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
} }
} }
if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) &&
nxagentOption(AllScreens) == 0) !nxagentOption(AllScreens))
{ {
nxagentChangeOption(Width, width); nxagentChangeOption(Width, width);
nxagentChangeOption(Height, height); nxagentChangeOption(Height, height);
...@@ -455,8 +455,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -455,8 +455,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight); result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight);
if (result == 1 && nxagentOption(DesktopResize) == 1 && if (result == 1 && nxagentOption(DesktopResize) &&
nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) !nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{ {
nxagentRandRSetWindowsSize(width, height); nxagentRandRSetWindowsSize(width, height);
nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height)); nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height));
......
...@@ -385,7 +385,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -385,7 +385,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
else else
{ {
if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized && if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized &&
nxagentGCTrap == 0) !nxagentGCTrap)
{ {
/* /*
* If the tile is corrupted and is not too * If the tile is corrupted and is not too
...@@ -437,7 +437,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -437,7 +437,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
if (mask & GCStipple) if (mask & GCStipple)
{ {
if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized && if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized &&
nxagentGCTrap == 0) !nxagentGCTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n", fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n",
...@@ -535,7 +535,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -535,7 +535,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
{ {
mask &= ~GCDashList; mask &= ~GCDashList;
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetDashes(nxagentDisplay, nxagentGC(pGC), XSetDashes(nxagentDisplay, nxagentGC(pGC),
pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList); pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
...@@ -549,7 +549,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -549,7 +549,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
changeFlag += nxagentTestGC(values.arc_mode, arc_mode); changeFlag += nxagentTestGC(values.arc_mode, arc_mode);
} }
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n", fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n",
...@@ -668,7 +668,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -668,7 +668,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{ {
case CT_NONE: case CT_NONE:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (clipsMatch == 0 && !nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
} }
...@@ -677,7 +677,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -677,7 +677,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_REGION: case CT_REGION:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (clipsMatch == 0 && !nxagentGCTrap)
{ {
nRects = RegionNumRects((RegionPtr)pValue); nRects = RegionNumRects((RegionPtr)pValue);
size = nRects * sizeof(*pRects); size = nRects * sizeof(*pRects);
...@@ -701,7 +701,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -701,7 +701,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_PIXMAP: case CT_PIXMAP:
{ {
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), XSetClipMask(nxagentDisplay, nxagentGC(pGC),
nxagentPixmap((PixmapPtr)pValue)); nxagentPixmap((PixmapPtr)pValue));
...@@ -719,7 +719,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -719,7 +719,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_UNSORTED: case CT_UNSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (clipsMatch == 0 && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -730,7 +730,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -730,7 +730,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YSORTED: case CT_YSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (clipsMatch == 0 && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -741,7 +741,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -741,7 +741,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YXSORTED: case CT_YXSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (clipsMatch == 0 && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -752,7 +752,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -752,7 +752,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YXBANDED: case CT_YXBANDED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (clipsMatch == 0 && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -809,7 +809,7 @@ void nxagentDestroyClip(GCPtr pGC) ...@@ -809,7 +809,7 @@ void nxagentDestroyClip(GCPtr pGC)
nxagentDestroyClipHelper(pGC); nxagentDestroyClipHelper(pGC);
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
} }
...@@ -1453,7 +1453,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen) ...@@ -1453,7 +1453,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen)
nxagentSaveGCTrap = nxagentGCTrap; nxagentSaveGCTrap = nxagentGCTrap;
nxagentGCTrap = 0; nxagentGCTrap = False;
pGC = GetScratchGC(depth, pScreen); pGC = GetScratchGC(depth, pScreen);
......
...@@ -80,7 +80,7 @@ static int nxagentSaveGCTrap; ...@@ -80,7 +80,7 @@ static int nxagentSaveGCTrap;
{ \ { \
nxagentSaveGCTrap = nxagentGCTrap;\ nxagentSaveGCTrap = nxagentGCTrap;\
\ \
nxagentGCTrap = 1; \ nxagentGCTrap = True; \
} }
#define RESET_GC_TRAP() \ #define RESET_GC_TRAP() \
...@@ -696,7 +696,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -696,7 +696,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
} }
if (nxagentGCTrap == 1 || nxagentShmTrap == 1) if (nxagentGCTrap || nxagentShmTrap)
{ {
if (pSrcDrawable -> type == DRAWABLE_PIXMAP && if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
pDstDrawable -> type == DRAWABLE_PIXMAP) pDstDrawable -> type == DRAWABLE_PIXMAP)
...@@ -730,7 +730,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -730,7 +730,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
* to the check in Image.c, this is of little use. * to the check in Image.c, this is of little use.
*/ */
if (nxagentOption(IgnoreVisibility) == 0 && pDstDrawable -> type == DRAWABLE_WINDOW && if (!nxagentOption(IgnoreVisibility) && pDstDrawable -> type == DRAWABLE_WINDOW &&
(nxagentWindowIsVisible((WindowPtr) pDstDrawable) == 0 || (nxagentWindowIsVisible((WindowPtr) pDstDrawable) == 0 ||
(nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0)))
{ {
...@@ -934,7 +934,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -934,7 +934,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
(void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height);
#endif #endif
if (nxagentGCTrap == 1 || nxagentShmTrap == 1) if (nxagentGCTrap || nxagentShmTrap)
{ {
if (pSrcDrawable -> type == DRAWABLE_PIXMAP && if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
pDstDrawable -> type == DRAWABLE_PIXMAP) pDstDrawable -> type == DRAWABLE_PIXMAP)
...@@ -1118,7 +1118,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, ...@@ -1118,7 +1118,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
(void *) pDrawable, (void *) pGC, nPoints); (void *) pDrawable, (void *) pGC, nPoints);
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1175,7 +1175,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, ...@@ -1175,7 +1175,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode, void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode,
int nPoints, xPoint *pPoints) int nPoints, xPoint *pPoints)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1248,7 +1248,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1248,7 +1248,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC,
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1325,7 +1325,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1325,7 +1325,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1390,7 +1390,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1390,7 +1390,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC,
int nArcs, xArc *pArcs) int nArcs, xArc *pArcs)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1449,7 +1449,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, ...@@ -1449,7 +1449,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
{ {
xPoint *newPoints = NULL; xPoint *newPoints = NULL;
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1571,7 +1571,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1571,7 +1571,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1719,7 +1719,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1719,7 +1719,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
int nArcs, xArc *pArcs) int nArcs, xArc *pArcs)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1798,7 +1798,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1798,7 +1798,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x,
width = XTextWidth(nxagentFontStruct(pGC->font), string, count); width = XTextWidth(nxagentFontStruct(pGC->font), string, count);
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1871,7 +1871,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1871,7 +1871,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x,
width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count); width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count);
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1930,7 +1930,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1930,7 +1930,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x,
void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, char *string) int y, int count, char *string)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1987,7 +1987,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1987,7 +1987,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x,
void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, unsigned short *string) int y, int count, unsigned short *string)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
......
...@@ -680,7 +680,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -680,7 +680,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
* the session. * the session.
*/ */
if (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0) if (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState); fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState);
......
...@@ -428,7 +428,7 @@ FIXME: Here the split trap is always set and so the caching of ...@@ -428,7 +428,7 @@ FIXME: Here the split trap is always set and so the caching of
resource, nxagentSplitTrap); resource, nxagentSplitTrap);
#endif #endif
if (nxagentSplitTrap == 1 || nxagentUnpackAlpha[resource] == NULL || if (nxagentSplitTrap || nxagentUnpackAlpha[resource] == NULL ||
nxagentUnpackAlpha[resource] -> size != size || nxagentUnpackAlpha[resource] -> size != size ||
memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0) memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0)
{ {
...@@ -584,8 +584,8 @@ FIXME: Should use these. ...@@ -584,8 +584,8 @@ FIXME: Should use these.
int framebuffer = 1; int framebuffer = 1;
int realize = 1; int realize = 1;
*/ */
if (nxagentGCTrap == 1 && nxagentReconnectTrap == 0 && if (nxagentGCTrap && !nxagentReconnectTrap &&
nxagentFBTrap == 0 && nxagentShmTrap == 0) !nxagentFBTrap && !nxagentShmTrap)
{ {
if (pDrawable -> type == DRAWABLE_PIXMAP) if (pDrawable -> type == DRAWABLE_PIXMAP)
{ {
...@@ -601,11 +601,10 @@ FIXME: Should use these. ...@@ -601,11 +601,10 @@ FIXME: Should use these.
goto nxagentPutImageEnd; goto nxagentPutImageEnd;
} }
if (nxagentReconnectTrap == 0 && if (!nxagentReconnectTrap && !nxagentSplitTrap)
nxagentSplitTrap == 0)
{ {
if (pDrawable -> type == DRAWABLE_PIXMAP && if (pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentFBTrap == 0 && nxagentShmTrap == 0) !nxagentFBTrap && !nxagentShmTrap)
{ {
fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth, fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth,
dstX, dstY, dstWidth, dstHeight, leftPad, format, data); dstX, dstY, dstWidth, dstHeight, leftPad, format, data);
...@@ -693,11 +692,11 @@ FIXME: Should use these. ...@@ -693,11 +692,11 @@ FIXME: Should use these.
/* /*
FIXME: Should we disable the split with link LAN? FIXME: Should we disable the split with link LAN?
split = (nxagentOption(Streaming) == 1 && split = (nxagentOption(Streaming) &&
nxagentOption(LinkType) != LINK_TYPE_NONE && nxagentOption(LinkType) != LINK_TYPE_NONE &&
nxagentOption(LinkType) != LINK_TYPE_LAN nxagentOption(LinkType) != LINK_TYPE_LAN
*/ */
split = (nxagentOption(Streaming) == 1 && split = (nxagentOption(Streaming) &&
nxagentOption(LinkType) != LINK_TYPE_NONE nxagentOption(LinkType) != LINK_TYPE_NONE
/* /*
FIXME: Do we stream the images from GLX or Xv? If we do that, FIXME: Do we stream the images from GLX or Xv? If we do that,
...@@ -710,8 +709,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, ...@@ -710,8 +709,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that,
/* /*
FIXME: Temporarily stream the GLX data. FIXME: Temporarily stream the GLX data.
&& nxagentGlxTrap == 0 && !nxagentGlxTrap
&& nxagentXvTrap == 0 && !nxagentXvTrap
*/ */
); );
...@@ -720,12 +719,11 @@ FIXME: Temporarily stream the GLX data. ...@@ -720,12 +719,11 @@ FIXME: Temporarily stream the GLX data.
* is less than 15. * is less than 15.
*/ */
if (split == 1 && (nxagentSplitTrap == 1 || depth < 15)) if (split == 1 && (nxagentSplitTrap || depth < 15))
{ {
#ifdef TEST #ifdef TEST
if (nxagentSplitTrap == 1 || if (nxagentSplitTrap || nxagentReconnectTrap)
nxagentReconnectTrap == 1)
{ {
fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] " fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] "
"depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth);
...@@ -767,7 +765,7 @@ FIXME: Temporarily stream the GLX data. ...@@ -767,7 +765,7 @@ FIXME: Temporarily stream the GLX data.
*/ */
if (nxagentOption(LinkType) != LINK_TYPE_NONE && if (nxagentOption(LinkType) != LINK_TYPE_NONE &&
(nxagentGlxTrap == 1 || nxagentXvTrap == 1)) (nxagentGlxTrap || nxagentXvTrap))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPutImage: Disabling the use of the cache with GLX or Xvideo.\n"); fprintf(stderr, "nxagentPutImage: Disabling the use of the cache with GLX or Xvideo.\n");
...@@ -974,7 +972,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -974,7 +972,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
bytesPerLine = nxagentImagePad(w, format, leftPad, depth); bytesPerLine = nxagentImagePad(w, format, leftPad, depth);
if (nxagentOption(Shadow) == 1 && format == ZPixmap && if (nxagentOption(Shadow) && format == ZPixmap &&
(nxagentOption(XRatio) != DONT_SCALE || (nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE) && nxagentOption(YRatio) != DONT_SCALE) &&
pDrawable == (DrawablePtr) nxagentShadowPixmapPtr) pDrawable == (DrawablePtr) nxagentShadowPixmapPtr)
...@@ -1197,7 +1195,7 @@ FIXME: Should use an unpack resource here. ...@@ -1197,7 +1195,7 @@ FIXME: Should use an unpack resource here.
if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT || if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT ||
nxagentImageLength(w, h, format, leftPad, depth) <= nxagentImageLength(w, h, format, leftPad, depth) <=
IMAGE_PACK_LENGTH || nxagentLosslessTrap == 1) IMAGE_PACK_LENGTH || nxagentLosslessTrap)
{ {
if (nxagentPackLossless == PACK_NONE) if (nxagentPackLossless == PACK_NONE)
{ {
...@@ -1273,8 +1271,8 @@ FIXME: Should try to locate the image anyway, if the lossless ...@@ -1273,8 +1271,8 @@ FIXME: Should try to locate the image anyway, if the lossless
again using the preferred method. again using the preferred method.
*/ */
if (nxagentNeedCache(plainImage, packMethod) && if (nxagentNeedCache(plainImage, packMethod) &&
nxagentGlxTrap == 0 && nxagentXvTrap == 0 && !nxagentGlxTrap && !nxagentXvTrap &&
nxagentLosslessTrap == 0 && NXImageCacheSize > 0) !nxagentLosslessTrap && NXImageCacheSize > 0)
{ {
/* /*
* Be sure that the padding bits are * Be sure that the padding bits are
...@@ -1341,7 +1339,7 @@ FIXME: There should be a callback registered by the agent that ...@@ -1341,7 +1339,7 @@ FIXME: There should be a callback registered by the agent that
* compress better. * compress better.
*/ */
if (lossless == 0 && nxagentOption(Adaptive) == 1) if (lossless == 0 && nxagentOption(Adaptive))
{ {
int ratio = nxagentUniquePixels(plainImage); int ratio = nxagentUniquePixels(plainImage);
......
...@@ -753,7 +753,7 @@ XkbError: ...@@ -753,7 +753,7 @@ XkbError:
fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL"); fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL");
#endif #endif
if (nxagentX2go == 1 && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0)) if (nxagentX2go && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "%s: changing nxagentKeyboard from [null/null] to [clone].\n", __func__); fprintf(stderr, "%s: changing nxagentKeyboard from [null/null] to [clone].\n", __func__);
...@@ -873,7 +873,7 @@ XkbError: ...@@ -873,7 +873,7 @@ XkbError:
* instead of a file. Which is achieved by passing NULL to * instead of a file. Which is achieved by passing NULL to
* nxagentWriteKeyboardFile. * nxagentWriteKeyboardFile.
*/ */
if (nxagentX2go == 1) if (nxagentX2go)
nxagentWriteKeyboardDir(); nxagentWriteKeyboardDir();
} }
else else
...@@ -891,7 +891,7 @@ XkbError: ...@@ -891,7 +891,7 @@ XkbError:
* know about that yet. Once x2go starts using clone * know about that yet. Once x2go starts using clone
* we can drop this here. * we can drop this here.
*/ */
if (nxagentX2go == 1) if (nxagentX2go)
nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions); nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions);
} }
} }
...@@ -935,7 +935,7 @@ XkbError: ...@@ -935,7 +935,7 @@ XkbError:
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
} }
if (nxagentOption(Shadow) == 1 && pDev && pDev->key) if (nxagentOption(Shadow) && pDev && pDev->key)
{ {
NXShadowInitKeymap(&(pDev->key->curKeySyms)); NXShadowInitKeymap(&(pDev->key->curKeySyms));
} }
......
...@@ -326,7 +326,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -326,7 +326,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
clientReady[0] = 0; clientReady[0] = 0;
if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n",
...@@ -339,7 +339,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -339,7 +339,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if (serverGeneration > nxagentMaxAllowedResets && if (serverGeneration > nxagentMaxAllowedResets &&
nxagentSessionState == SESSION_STARTING && nxagentSessionState == SESSION_STARTING &&
(nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) (!nxagentOption(Xdmcp) || nxagentXdmcpUp == 1))
{ {
#ifdef NX_DEBUG_INPUT #ifdef NX_DEBUG_INPUT
fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n",
...@@ -568,7 +568,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -568,7 +568,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString()); fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString());
} }
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
NXShadowDestroy(); NXShadowDestroy();
} }
......
...@@ -199,7 +199,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, ...@@ -199,7 +199,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
* } * }
*/ */
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
/* /*
* FIXME: We should use the correct value * FIXME: We should use the correct value
...@@ -245,7 +245,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) ...@@ -245,7 +245,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse)
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
XUngrabPointer(nxagentDisplay, CurrentTime); XUngrabPointer(nxagentDisplay, CurrentTime);
......
...@@ -116,7 +116,7 @@ static int __glXDispatch(ClientPtr client) ...@@ -116,7 +116,7 @@ static int __glXDispatch(ClientPtr client)
* dispatching a GLX operation. * dispatching a GLX operation.
*/ */
nxagentGlxTrap = 1; nxagentGlxTrap = True;
#ifdef TEST #ifdef TEST
fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n",
...@@ -125,7 +125,7 @@ static int __glXDispatch(ClientPtr client) ...@@ -125,7 +125,7 @@ static int __glXDispatch(ClientPtr client)
retval = (*proc)(cl, (GLbyte *) stuff); retval = (*proc)(cl, (GLbyte *) stuff);
nxagentGlxTrap = 0; nxagentGlxTrap = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n",
......
...@@ -189,7 +189,7 @@ ProcChangeProperty(ClientPtr client) ...@@ -189,7 +189,7 @@ ProcChangeProperty(ClientPtr client)
return err; return err;
else else
{ {
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format,
(int) mode, len, (void *) &stuff[1]); (int) mode, len, (void *) &stuff[1]);
......
...@@ -1683,11 +1683,11 @@ ProcRenderDispatch (ClientPtr client) ...@@ -1683,11 +1683,11 @@ ProcRenderDispatch (ClientPtr client)
* avoid reentrancy in GCOps.c. * avoid reentrancy in GCOps.c.
*/ */
nxagentGCTrap = 1; nxagentGCTrap = True;
result = (*ProcRenderVector[stuff->data]) (client); result = (*ProcRenderVector[stuff->data]) (client);
nxagentGCTrap = 0; nxagentGCTrap = False;
return result; return result;
} }
...@@ -1720,11 +1720,11 @@ SProcRenderDispatch (ClientPtr client) ...@@ -1720,11 +1720,11 @@ SProcRenderDispatch (ClientPtr client)
* avoid reentrancy in GCOps.c. * avoid reentrancy in GCOps.c.
*/ */
nxagentGCTrap = 1; nxagentGCTrap = True;
result = (*SProcRenderVector[stuff->data]) (client); result = (*SProcRenderVector[stuff->data]) (client);
nxagentGCTrap = 0; nxagentGCTrap = False;
return result; return result;
} }
......
...@@ -96,7 +96,7 @@ ShmExtensionInit(void) ...@@ -96,7 +96,7 @@ ShmExtensionInit(void)
#endif #endif
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
if (nxagentOption(SharedMemory) == False) if (!nxagentOption(SharedMemory))
{ {
return; return;
} }
...@@ -207,11 +207,11 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) ...@@ -207,11 +207,11 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
{ {
/* Careful! This wrapper DEACTIVATES the trap! */ /* Careful! This wrapper DEACTIVATES the trap! */
nxagentShmTrap = 0; nxagentShmTrap = False;
nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data); nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data);
nxagentShmTrap = 1; nxagentShmTrap = True;
return; return;
} }
...@@ -476,11 +476,11 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) ...@@ -476,11 +476,11 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
{ {
PixmapPtr result; PixmapPtr result;
nxagentShmPixmapTrap = 1; nxagentShmPixmapTrap = True;
result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr); result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr);
nxagentShmPixmapTrap = 0; nxagentShmPixmapTrap = False;
return result; return result;
} }
...@@ -553,11 +553,11 @@ ProcShmDispatch (register ClientPtr client) ...@@ -553,11 +553,11 @@ ProcShmDispatch (register ClientPtr client)
{ {
int result; int result;
nxagentShmTrap = 1; nxagentShmTrap = True;
result = nxagent_ProcShmDispatch(client); result = nxagent_ProcShmDispatch(client);
nxagentShmTrap = 0; nxagentShmTrap = False;
return result; return result;
} }
...@@ -591,13 +591,13 @@ SProcShmDispatch (client) ...@@ -591,13 +591,13 @@ SProcShmDispatch (client)
#endif #endif
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
nxagentShmTrap = 1; nxagentShmTrap = True;
#endif #endif
result = SProcShmPutImage(client); result = SProcShmPutImage(client);
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
nxagentShmTrap = 0; nxagentShmTrap = False;
#endif #endif
#ifdef TEST #ifdef TEST
......
...@@ -561,7 +561,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP ...@@ -561,7 +561,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) && if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) &&
pWin -> overrideRedirect == 0 && pWin -> overrideRedirect == 0 &&
nxagentScreenTrap == 0) !nxagentScreenTrap)
{ {
nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask); nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask);
......
...@@ -162,11 +162,11 @@ ProcXvDispatch(ClientPtr client) ...@@ -162,11 +162,11 @@ ProcXvDispatch(ClientPtr client)
stuff->data, client -> index); stuff->data, client -> index);
#endif #endif
nxagentXvTrap = 1; nxagentXvTrap = True;
result = nxagent_ProcXvDispatch(client); result = nxagent_ProcXvDispatch(client);
nxagentXvTrap = 0; nxagentXvTrap = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n",
...@@ -239,11 +239,11 @@ SProcXvDispatch(ClientPtr client) ...@@ -239,11 +239,11 @@ SProcXvDispatch(ClientPtr client)
stuff->data, client -> index); stuff->data, client -> index);
#endif #endif
nxagentXvTrap = 1; nxagentXvTrap = True;
result = nxagent_SProcXvDispatch(client); result = nxagent_SProcXvDispatch(client);
nxagentXvTrap = 0; nxagentXvTrap = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "SProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", fprintf(stderr, "SProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n",
......
...@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE ...@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
(nxagentSplitTrap == 0 && \ (!nxagentSplitTrap && \
nxagentOption(DeferLevel) > 0) nxagentOption(DeferLevel) > 0)
/* /*
......
...@@ -217,7 +217,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -217,7 +217,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
* id of the drawable in the checksum. * id of the drawable in the checksum.
*/ */
if (width != 0 && height != 0 && nxagentGCTrap == 0) if (width != 0 && height != 0 && !nxagentGCTrap)
{ {
pPixmapPriv -> id = XCreatePixmap(nxagentDisplay, pPixmapPriv -> id = XCreatePixmap(nxagentDisplay,
nxagentDefaultWindows[pScreen -> myNum], nxagentDefaultWindows[pScreen -> myNum],
...@@ -348,7 +348,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -348,7 +348,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
fprintf(stderr, "Warning: Disabling render extension due to missing pixmap format.\n"); fprintf(stderr, "Warning: Disabling render extension due to missing pixmap format.\n");
#endif #endif
nxagentRenderTrap = 1; nxagentRenderTrap = True;
} }
nxagentDestroyPixmap(pPixmap); nxagentDestroyPixmap(pPixmap);
...@@ -923,11 +923,11 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2) ...@@ -923,11 +923,11 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2)
return; return;
} }
nxagentSplitTrap = 1; nxagentSplitTrap = True;
*pBool = nxagentSynchronizeDrawableData((DrawablePtr) pPixmap, NEVER_BREAK, NULL); *pBool = nxagentSynchronizeDrawableData((DrawablePtr) pPixmap, NEVER_BREAK, NULL);
nxagentSplitTrap = 0; nxagentSplitTrap = False;
if (!*pBool) if (!*pBool)
{ {
...@@ -1256,11 +1256,11 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, ...@@ -1256,11 +1256,11 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
saveTrap = nxagentGCTrap; saveTrap = nxagentGCTrap;
nxagentGCTrap = 0; nxagentGCTrap = False;
nxagentSplitTrap = 1; nxagentSplitTrap = True;
nxagentFBTrap = 1; nxagentFBTrap = True;
if ((data = malloc(length)) != NULL) if ((data = malloc(length)) != NULL)
{ {
...@@ -1281,9 +1281,9 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, ...@@ -1281,9 +1281,9 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentGCTrap = saveTrap; nxagentGCTrap = saveTrap;
nxagentSplitTrap = 0; nxagentSplitTrap = False;
nxagentFBTrap = 0; nxagentFBTrap = False;
nxagentFreeScratchGC(pGC); nxagentFreeScratchGC(pGC);
} }
......
...@@ -85,7 +85,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) ...@@ -85,7 +85,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
* window. * window.
*/ */
if (nxagentOption(DeviceControl) == True) if (nxagentOption(DeviceControl))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangePointerControl: WARNING! Propagating changes to pointer settings.\n"); fprintf(stderr, "nxagentChangePointerControl: WARNING! Propagating changes to pointer settings.\n");
......
...@@ -240,7 +240,7 @@ TODO: This should be reset only when ...@@ -240,7 +240,7 @@ TODO: This should be reset only when
*/ */
nxagentException.ioError = 0; nxagentException.ioError = 0;
if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING) if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING)
{ {
if (nxagentSessionState == SESSION_UP) if (nxagentSessionState == SESSION_UP)
{ {
...@@ -338,7 +338,7 @@ void nxagentInitializeRecLossyLevel(void) ...@@ -338,7 +338,7 @@ void nxagentInitializeRecLossyLevel(void)
void nxagentInitReconnector(void) void nxagentInitReconnector(void)
{ {
nxagentReconnectTrap = 0; nxagentReconnectTrap = False;
reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int)); reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int));
reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int)); reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int));
...@@ -608,7 +608,7 @@ Bool nxagentReconnectSession(void) ...@@ -608,7 +608,7 @@ Bool nxagentReconnectSession(void)
nxagentOldKeyboard = NULL; nxagentOldKeyboard = NULL;
} }
if (nxagentOption(ResetKeyboardAtResume) == 1 && if (nxagentOption(ResetKeyboardAtResume) &&
(nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
strcmp(nxagentKeyboard, "query") == 0 || strcmp(nxagentKeyboard, "query") == 0 ||
...@@ -648,7 +648,7 @@ Bool nxagentReconnectSession(void) ...@@ -648,7 +648,7 @@ Bool nxagentReconnectSession(void)
nxagentRedirectDefaultWindows(); nxagentRedirectDefaultWindows();
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama))
{ {
nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight)); nxagentOption(RootHeight));
......
...@@ -569,11 +569,11 @@ int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -569,11 +569,11 @@ int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
nxagentMarkCorruptedRegion(pPicture -> pDrawable, NULL); nxagentMarkCorruptedRegion(pPicture -> pDrawable, NULL);
nxagentLosslessTrap = 1; nxagentLosslessTrap = True;
nxagentSynchronizeDrawable(pPicture -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); nxagentSynchronizeDrawable(pPicture -> pDrawable, DO_WAIT, NEVER_BREAK, NULL);
nxagentLosslessTrap = 0; nxagentLosslessTrap = False;
cid = XRenderCreateCursor(nxagentDisplay, nxagentPicture(pPicture), x, y); cid = XRenderCreateCursor(nxagentDisplay, nxagentPicture(pPicture), x, y);
...@@ -2741,7 +2741,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2) ...@@ -2741,7 +2741,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2)
int i; int i;
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentReconnectGlyphSet: GlyphSet at [%p].\n", (void *) pGly); fprintf(stderr, "nxagentReconnectGlyphSet: GlyphSet at [%p].\n", (void *) pGly);
......
...@@ -373,9 +373,9 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) ...@@ -373,9 +373,9 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
mask = CWSibling | CWStackMode; mask = CWSibling | CWStackMode;
values[0] = pWin -> drawable.id; values[0] = pWin -> drawable.id;
pClient = wClient(toplevel[ntoplevel]); pClient = wClient(toplevel[ntoplevel]);
nxagentScreenTrap = 1; nxagentScreenTrap = True;
ConfigureWindow(toplevel[ntoplevel], mask, (XID *) values, pClient); ConfigureWindow(toplevel[ntoplevel], mask, (XID *) values, pClient);
nxagentScreenTrap = 0; nxagentScreenTrap = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentRootlessRestack: Restacked window [%p].\n", (void*) toplevel[ntoplevel]); fprintf(stderr, "nxagentRootlessRestack: Restacked window [%p].\n", (void*) toplevel[ntoplevel]);
......
...@@ -596,7 +596,7 @@ FIXME: Do we need to check the key grab if the ...@@ -596,7 +596,7 @@ FIXME: Do we need to check the key grab if the
raise(SIGTERM); raise(SIGTERM);
} }
else if (nxagentOption(Persistent) == 0) else if (!nxagentOption(Persistent))
{ {
fprintf(stderr, "Info: Terminating session with persistence not allowed.\n"); fprintf(stderr, "Info: Terminating session with persistence not allowed.\n");
...@@ -871,7 +871,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -871,7 +871,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
pScreen->myNum); pScreen->myNum);
#endif #endif
if (nxagentRenderEnable && nxagentReconnectTrap == False) if (nxagentRenderEnable && !nxagentReconnectTrap)
{ {
PictureScreenPrivateIndex = -1; PictureScreenPrivateIndex = -1;
} }
...@@ -926,7 +926,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -926,7 +926,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* user geometry then. * user geometry then.
*/ */
if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) if (!nxagentReconnectTrap && !nxagentOption(Rootless))
{ {
if (nxagentUserGeometry.flag & XValue) if (nxagentUserGeometry.flag & XValue)
{ {
...@@ -970,7 +970,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -970,7 +970,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* the screen if we are either in rootless or in fullscreen mode. * the screen if we are either in rootless or in fullscreen mode.
*/ */
if (nxagentOption(Rootless) == False && !nxagentWMIsRunning) if (!nxagentOption(Rootless) && !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");
...@@ -979,7 +979,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -979,7 +979,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(Fullscreen, True); nxagentChangeOption(Fullscreen, True);
if (nxagentOption(ClientOs) == ClientOsWinnt && if (nxagentOption(ClientOs) == ClientOsWinnt &&
(nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup))
{ {
NXSetExposeParameters(nxagentDisplay, 0, 0, 0); NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
} }
...@@ -988,7 +988,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -988,7 +988,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if (nxagentOption(Fullscreen) && if (nxagentOption(Fullscreen) &&
nxagentWMIsRunning && nxagentWMIsRunning &&
nxagentReconnectTrap && nxagentReconnectTrap &&
nxagentResizeDesktopAtStartup == False && !nxagentResizeDesktopAtStartup &&
nxagentXServerGeometryChanged()) nxagentXServerGeometryChanged())
{ {
#ifdef TEST #ifdef TEST
...@@ -1019,7 +1019,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1019,7 +1019,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(Height, h); nxagentChangeOption(Height, h);
/* first time screen initialization or resize during reconnect */ /* first time screen initialization or resize during reconnect */
if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)
{ {
if (nxagentOption(RootWidth) >= w) if (nxagentOption(RootWidth) >= w)
{ {
...@@ -1072,7 +1072,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1072,7 +1072,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* screen is initialized for the first time. * screen is initialized for the first time.
*/ */
if (nxagentReconnectTrap == False) if (!nxagentReconnectTrap)
{ {
nxagentChangeOption(RootX, 0); nxagentChangeOption(RootX, 0);
nxagentChangeOption(RootY, 0); nxagentChangeOption(RootY, 0);
...@@ -1111,7 +1111,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1111,7 +1111,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* the root window isn't bigger than the X server root window.. * the root window isn't bigger than the X server root window..
*/ */
if (nxagentReconnectTrap == False) if (!nxagentReconnectTrap)
{ {
if ((nxagentOption(RootWidth) < w) && if ((nxagentOption(RootWidth) < w) &&
!(nxagentUserGeometry.flag & WidthValue)) !(nxagentUserGeometry.flag & WidthValue))
...@@ -1143,7 +1143,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1143,7 +1143,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth));
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight));
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
if (nxagentOption(Persistent)) if (nxagentOption(Persistent))
{ {
...@@ -1344,11 +1344,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1344,11 +1344,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
rootDepth, (long unsigned int)defaultVisual); rootDepth, (long unsigned int)defaultVisual);
#endif #endif
if ((monitorResolution < 1) && (nxagentAutoDPI == False)) if ((monitorResolution < 1) && !nxagentAutoDPI)
{ {
monitorResolution = NXAGENT_DEFAULT_DPI; monitorResolution = NXAGENT_DEFAULT_DPI;
} }
else if ((monitorResolution < 1) && (nxagentAutoDPI == True)) else if ((monitorResolution < 1) && nxagentAutoDPI)
{ {
monitorResolution = NXAGENT_AUTO_DPI; monitorResolution = NXAGENT_AUTO_DPI;
} }
...@@ -1699,21 +1699,21 @@ N/A ...@@ -1699,21 +1699,21 @@ N/A
#endif #endif
if (nxagentDoFullGeneration == 1 || if (nxagentDoFullGeneration == 1 ||
nxagentReconnectTrap == 1) nxagentReconnectTrap)
{ {
valuemask = CWBackPixel | CWEventMask | CWColormap | valuemask = CWBackPixel | CWEventMask | CWColormap |
(nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0); (nxagentOption(AllScreens) ? CWOverrideRedirect : 0);
attributes.background_pixel = nxagentBlackPixel; attributes.background_pixel = nxagentBlackPixel;
attributes.event_mask = nxagentGetDefaultEventMask(); attributes.event_mask = nxagentGetDefaultEventMask();
attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen));
if (nxagentOption(AllScreens) == 1) if (nxagentOption(AllScreens))
{ {
attributes.override_redirect = True; attributes.override_redirect = True;
} }
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
if (nxagentReconnectTrap) if (nxagentReconnectTrap)
{ {
...@@ -1749,7 +1749,7 @@ N/A ...@@ -1749,7 +1749,7 @@ N/A
* handling the splash screen. * handling the splash screen.
*/ */
if (nxagentOption(Rootless) == True) if (nxagentOption(Rootless))
{ {
nxagentDefaultWindows[pScreen->myNum] = DefaultRootWindow(nxagentDisplay); nxagentDefaultWindows[pScreen->myNum] = DefaultRootWindow(nxagentDisplay);
...@@ -1776,7 +1776,7 @@ N/A ...@@ -1776,7 +1776,7 @@ N/A
nxagentDefaultVisual(pScreen), nxagentDefaultVisual(pScreen),
valuemask, &attributes); valuemask, &attributes);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
valuemask = CWEventMask; valuemask = CWEventMask;
mask = PointerMotionMask; mask = PointerMotionMask;
...@@ -1884,7 +1884,7 @@ N/A ...@@ -1884,7 +1884,7 @@ N/A
sizeHints->width = nxagentOption(RootWidth); sizeHints->width = nxagentOption(RootWidth);
sizeHints->height = nxagentOption(RootHeight); sizeHints->height = nxagentOption(RootHeight);
if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen))
{ {
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
...@@ -2000,7 +2000,7 @@ N/A ...@@ -2000,7 +2000,7 @@ N/A
/* FIXME: This doing the same thing in both cases. The /* FIXME: This doing the same thing in both cases. The
comments do not seem accurate (anymore?) */ comments do not seem accurate (anymore?) */
if (nxagentOption(Rootless) == False) if (!nxagentOption(Rootless))
{ {
/* /*
* Set the WM_DELETE_WINDOW protocol for the main agent * Set the WM_DELETE_WINDOW protocol for the main agent
...@@ -2049,7 +2049,7 @@ N/A ...@@ -2049,7 +2049,7 @@ N/A
* and pointer settings. * and pointer settings.
*/ */
if (nxagentOption(DeviceControl) == False) if (!nxagentOption(DeviceControl))
{ {
fprintf(stderr, "Info: Not using local device configuration changes.\n"); fprintf(stderr, "Info: Not using local device configuration changes.\n");
} }
...@@ -2428,13 +2428,13 @@ FIXME: We should try to restore the previously ...@@ -2428,13 +2428,13 @@ FIXME: We should try to restore the previously
* Change agent window size and size hints. * Change agent window size and size hints.
*/ */
if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)) if (!nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{ {
nxagentSetWMNormalHints(pScreen->myNum, width, height); nxagentSetWMNormalHints(pScreen->myNum, width, height);
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height);
} }
...@@ -2589,7 +2589,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2589,7 +2589,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
NXShadowSetDisplayUid(nxagentShadowUid); NXShadowSetDisplayUid(nxagentShadowUid);
} }
if (nxagentOption(UseDamage) == 0) if (!nxagentOption(UseDamage))
{ {
NXShadowDisableDamage(); NXShadowDisableDamage();
} }
...@@ -2634,7 +2634,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2634,7 +2634,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
#ifndef __CYGWIN32__ #ifndef __CYGWIN32__
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth,
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight);
...@@ -4571,7 +4571,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height) ...@@ -4571,7 +4571,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
sizeHints->width = width; sizeHints->width = width;
sizeHints->height = height; sizeHints->height = height;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* reentrancy in GC operations. * reentrancy in GC operations.
*/ */
int nxagentGCTrap = 0; int nxagentGCTrap = False;
/* /*
* Set if we are enqueing an internal * Set if we are enqueing an internal
...@@ -39,14 +39,14 @@ int nxagentGCTrap = 0; ...@@ -39,14 +39,14 @@ int nxagentGCTrap = 0;
* Window. Used to remove any screen operation. * Window. Used to remove any screen operation.
*/ */
int nxagentScreenTrap = 0; int nxagentScreenTrap = False;
/* /*
* Set if we detected that our RENDER * Set if we detected that our RENDER
* implementation is faulty. * implementation is faulty.
*/ */
int nxagentRenderTrap = 0; int nxagentRenderTrap = False;
/* /*
* Set if we are executing a GC operation * Set if we are executing a GC operation
...@@ -54,55 +54,55 @@ int nxagentRenderTrap = 0; ...@@ -54,55 +54,55 @@ int nxagentRenderTrap = 0;
* reentrancy in FB layer. * reentrancy in FB layer.
*/ */
int nxagentFBTrap = 0; int nxagentFBTrap = False;
/* /*
* Set if we are dispatching a shared * Set if we are dispatching a shared
* memory extension request. * memory extension request.
*/ */
int nxagentShmTrap = 0; int nxagentShmTrap = False;
/* /*
* Set if a shared pixmap operation is * Set if a shared pixmap operation is
* requested by the client. * requested by the client.
*/ */
int nxagentShmPixmapTrap = 0; int nxagentShmPixmapTrap = False;
/* /*
* Set if we are dispatching a XVideo * Set if we are dispatching a XVideo
* extension request. * extension request.
*/ */
int nxagentXvTrap = 0; int nxagentXvTrap = False;
/* /*
* Set if we are dispatching a GLX * Set if we are dispatching a GLX
* extension request. * extension request.
*/ */
int nxagentGlxTrap = 0; int nxagentGlxTrap = False;
/* /*
* Set while we are resuming the session. * Set while we are resuming the session.
*/ */
int nxagentReconnectTrap = 0; int nxagentReconnectTrap = False;
/* /*
* Set if we need to realize a drawable * Set if we need to realize a drawable
* by using a lossless encoding. * by using a lossless encoding.
*/ */
int nxagentLosslessTrap = 0; int nxagentLosslessTrap = False;
/* /*
* Set to force the synchronization of * Set to force the synchronization of
* a drawable. * a drawable.
*/ */
int nxagentSplitTrap = 0; int nxagentSplitTrap = False;
/* /*
* Set to avoid CapsLock synchronization * Set to avoid CapsLock synchronization
...@@ -110,7 +110,7 @@ int nxagentSplitTrap = 0; ...@@ -110,7 +110,7 @@ int nxagentSplitTrap = 0;
* key to be pressed in the session. * key to be pressed in the session.
*/ */
int nxagentXkbCapsTrap = 0; int nxagentXkbCapsTrap = False;
/* /*
* Set to avoid NumLock synchronization * Set to avoid NumLock synchronization
...@@ -118,5 +118,5 @@ int nxagentXkbCapsTrap = 0; ...@@ -118,5 +118,5 @@ int nxagentXkbCapsTrap = 0;
* key to be pressed in the session. * key to be pressed in the session.
*/ */
int nxagentXkbNumTrap = 0; int nxagentXkbNumTrap = False;
...@@ -26,6 +26,14 @@ ...@@ -26,6 +26,14 @@
#ifndef __Traps_H__ #ifndef __Traps_H__
#define __Traps_H__ #define __Traps_H__
#ifndef True
# define True 1
#endif
#ifndef False
# define False 0
#endif
/* /*
* Set if we are dispatching a render * Set if we are dispatching a render
* extension request. Used to avoid * extension request. Used to avoid
......
...@@ -397,7 +397,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) ...@@ -397,7 +397,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin) -> corruptedTimestamp = 0; nxagentWindowPriv(pWin) -> corruptedTimestamp = 0;
nxagentWindowPriv(pWin) -> splitResource = NULL; nxagentWindowPriv(pWin) -> splitResource = NULL;
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
if (pWin != nxagentRootlessWindow) if (pWin != nxagentRootlessWindow)
{ {
...@@ -557,7 +557,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -557,7 +557,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
{ {
nxagentPrivWindowPtr pWindowPriv; nxagentPrivWindowPtr pWindowPriv;
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return 1; return 1;
} }
...@@ -685,7 +685,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -685,7 +685,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return True; return True;
} }
...@@ -703,7 +703,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) ...@@ -703,7 +703,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return; return;
} }
...@@ -713,7 +713,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) ...@@ -713,7 +713,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{ {
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
return; return;
} }
...@@ -908,9 +908,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -908,9 +908,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w; nxagentFullscreenWindow = w;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)));
...@@ -959,12 +959,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -959,12 +959,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentIconWindow = nxagentFullscreenWindow = None; nxagentIconWindow = nxagentFullscreenWindow = None;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight)); nxagentOption(RootHeight));
...@@ -985,7 +985,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -985,7 +985,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight)); nxagentChangeOption(Height, nxagentOption(SavedHeight));
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1) if (nxagentOption(Shadow) && nxagentOption(DesktopResize))
{ {
nxagentShadowAdaptToRatio(); nxagentShadowAdaptToRatio();
} }
...@@ -1225,7 +1225,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1225,7 +1225,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x; int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x;
int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y; int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y;
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n"); fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n");
...@@ -1234,7 +1234,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1234,7 +1234,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
return; return;
} }
if (nxagentOption(Rootless) == 1 && if (nxagentOption(Rootless) &&
nxagentWindowTopLevel(pWin) == 1) nxagentWindowTopLevel(pWin) == 1)
{ {
mask &= ~(CWSibling | CWStackMode); mask &= ~(CWSibling | CWStackMode);
...@@ -1836,7 +1836,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired) ...@@ -1836,7 +1836,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
Bool nxagentRealizeWindow(WindowPtr pWin) Bool nxagentRealizeWindow(WindowPtr pWin)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return True; return True;
} }
...@@ -2427,7 +2427,7 @@ void nxagentRefreshWindows(WindowPtr pWin) ...@@ -2427,7 +2427,7 @@ void nxagentRefreshWindows(WindowPtr pWin)
void nxagentUnmapWindows(void) void nxagentUnmapWindows(void)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
for (int i = 0; i < screenInfo.numScreens; i++) for (int i = 0; i < screenInfo.numScreens; i++)
{ {
...@@ -2450,7 +2450,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2450,7 +2450,7 @@ void nxagentMapDefaultWindows(void)
MapWindow(pWin, serverClient); MapWindow(pWin, serverClient);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
/* /*
* Show the NX splash screen. * Show the NX splash screen.
...@@ -2470,7 +2470,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2470,7 +2470,7 @@ void nxagentMapDefaultWindows(void)
* Windows client. * Windows client.
*/ */
if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning) if (!nxagentOption(Shadow) || !nxagentWMIsRunning)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n", fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
...@@ -2479,7 +2479,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2479,7 +2479,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning) if (nxagentOption(Fullscreen) && nxagentWMIsRunning)
{ {
nxagentMaximizeToFullScreen(pScreen); nxagentMaximizeToFullScreen(pScreen);
} }
...@@ -2497,7 +2497,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2497,7 +2497,7 @@ void nxagentMapDefaultWindows(void)
* after the Root Window is mapped. * after the Root Window is mapped.
*/ */
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]); XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]);
} }
...@@ -2693,7 +2693,7 @@ Bool nxagentReconnectAllWindows(void *p0) ...@@ -2693,7 +2693,7 @@ Bool nxagentReconnectAllWindows(void *p0)
* Windows is raised. * Windows is raised.
*/ */
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
for (int i = 0; i < screenInfo.numScreens; i++) for (int i = 0; i < screenInfo.numScreens; i++)
{ {
...@@ -3196,7 +3196,7 @@ XXX: This would break Motif menus. ...@@ -3196,7 +3196,7 @@ XXX: This would break Motif menus.
XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum); XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum);
} }
} }
else if (nxagentOption(Rootless) == 0) else if (!nxagentOption(Rootless))
{ {
/* /*
* Map the root window. * Map the root window.
......
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