aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c32
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Composite.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Cursor.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Drawable.c34
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c98
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Extensions.c18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GC.c26
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GCOps.c32
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Handlers.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Image.c36
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXevents.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglxext.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXproperty.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXwindow.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixels.h2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmap.c18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pointer.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Reconnect.c10
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Render.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Rootless.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c100
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Trap.c26
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Trap.h8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c40
-rw-r--r--nx-X11/programs/Xserver/randr/rrdispatch.c4
31 files changed, 283 insertions, 285 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 949892f25..57bcfa425 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -522,7 +522,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
sscanf(argv[i], "%i", &level) == 1 &&
level >= 0 && level <= 2)
{
- if (nxagentOption(Shadow) == 0)
+ if (!nxagentOption(Shadow))
{
nxagentChangeOption(DeferLevel, level);
@@ -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;
@@ -1122,7 +1122,7 @@ static void nxagentParseSingleOption(char *name, char *value)
}
else if (!strcmp(name, "render"))
{
- if (nxagentReconnectTrap == True)
+ if (nxagentReconnectTrap)
{
#ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n");
@@ -1154,7 +1154,7 @@ static void nxagentParseSingleOption(char *name, char *value)
}
else if (!strcmp(name, "fullscreen"))
{
- if (nxagentReconnectTrap == True)
+ if (nxagentReconnectTrap)
{
#ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n");
@@ -1267,13 +1267,13 @@ static void nxagentParseSingleOption(char *name, char *value)
}
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)
{
- nxagentResizeDesktopAtStartup = 1;
+ nxagentResizeDesktopAtStartup = True;
}
else
{
@@ -1324,7 +1324,7 @@ static void nxagentParseSingleOption(char *name, char *value)
}
else if (!strcmp(name, "autodpi"))
{
- if (nxagentReconnectTrap == True)
+ if (nxagentReconnectTrap)
{
#ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n");
@@ -1793,7 +1793,7 @@ N/A
#endif
- if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Rootless) && nxagentOption(Fullscreen))
{
#ifdef TEST
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.
nxagentAlphaEnabled = False;
}
- if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp))
+ if (nxagentOption(Rootless) && nxagentOption(Xdmcp))
{
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.
* XDMCP sessions.
*/
- if (nxagentOption(Reset) == True && nxagentMaxAllowedResets == 0)
+ if (nxagentOption(Reset) && nxagentMaxAllowedResets == 0)
{
#ifdef WARNING
fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n");
@@ -2119,7 +2119,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
* to a standard XFree86 server.
*/
- if (nxagentOption(Reset) == False)
+ if (!nxagentOption(Reset))
{
#ifdef TEST
fprintf(stderr, "nxagentPostProcessArgs: Disabling dispatch of exception at server reset.\n");
@@ -2399,7 +2399,7 @@ void nxagentSetDeferLevel(void)
* of the agent.
*/
- if (nxagentOption(Streaming) == 1)
+ if (nxagentOption(Streaming))
{
fprintf(stderr, "Warning: Streaming of images not available in this agent.\n");
@@ -2484,7 +2484,7 @@ void nxagentSetDeferLevel(void)
* Set the defer timeout.
*/
- if (nxagentOption(Shadow) == 1)
+ if (nxagentOption(Shadow))
{
#ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n");
@@ -2499,7 +2499,7 @@ void nxagentSetDeferLevel(void)
* Set the defer level.
*/
- if (nxagentOption(Shadow) == 1)
+ if (nxagentOption(Shadow) )
{
#ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n");
@@ -2631,7 +2631,7 @@ void nxagentSetScheduler(void)
* The smart scheduler is the default.
*/
- if (nxagentOption(Shadow) == 1)
+ if (nxagentOption(Shadow))
{
#ifdef TEST
fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n");
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c
index e48671879..4cdcda9df 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c
@@ -59,7 +59,7 @@ void nxagentCompositeExtensionInit(void)
nxagentCompositeEnable = 0;
- if (nxagentOption(Composite) == 1)
+ if (nxagentOption(Composite))
{
int eventBase, errorBase;
@@ -119,7 +119,7 @@ void nxagentRedirectDefaultWindows(void)
{
int i;
- if (nxagentOption(Rootless) == 1 ||
+ if (nxagentOption(Rootless) ||
nxagentCompositeEnable == 0)
{
#ifdef TEST
@@ -159,7 +159,7 @@ void nxagentRedirectDefaultWindows(void)
void nxagentRedirectWindow(WindowPtr pWin)
{
- if (nxagentOption(Rootless) == 0 ||
+ if (!nxagentOption(Rootless) ||
nxagentCompositeEnable == 0)
{
#ifdef TEST
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
index a67115cec..41aa773d1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
@@ -134,7 +134,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None;
- if (nxagentOption(Rootless) == False)
+ if (!nxagentOption(Rootless))
{
XDefineCursor(nxagentDisplay,
nxagentInputWindows[pScreen -> myNum],
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index 127874962..89a191dce 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
@@ -313,7 +313,7 @@ static void nxagentSighupHandler(int signal)
}
else if (nxagentSessionState == SESSION_UP)
{
- if (nxagentOption(Persistent) == 1)
+ if (nxagentOption(Persistent))
{
#ifdef TEST
fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n");
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
index 88f3da3a9..a1eb08ad2 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
@@ -148,7 +148,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre
pDrawable = nxagentSplitDrawable(pDrawable);
- if (nxagentLosslessTrap == 0)
+ if (!nxagentLosslessTrap)
{
if (nxagentDrawableStatus(pDrawable) == Synchronized)
{
@@ -171,15 +171,15 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre
* transferred in a single operation.
*/
- nxagentFBTrap = 1;
+ nxagentFBTrap = True;
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
result = nxagentSynchronizeDrawableData(pDrawable, breakMask, owner);
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
- nxagentFBTrap = 0;
+ nxagentFBTrap = False;
if (wait == DO_WAIT && nxagentSplitResource(pDrawable) != NULL)
{
@@ -253,7 +253,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
* compression turned off.
*/
- if (nxagentLosslessTrap == 1)
+ if (nxagentLosslessTrap)
{
pGC = nxagentGetGraphicContext(pDrawable);
@@ -285,7 +285,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
goto nxagentSynchronizeDrawableDataEnd;
}
- else if (nxagentReconnectTrap == 1)
+ else if (nxagentReconnectTrap)
{
/*
* The pixmap data is not synchronized unless
@@ -298,7 +298,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
{
#ifdef TEST
- if (nxagentReconnectTrap == 1)
+ if (nxagentReconnectTrap)
{
static int totalLength;
static int totalReconnectedPixmaps;
@@ -586,11 +586,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
saveTrap = nxagentGCTrap;
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
- nxagentFBTrap = 1;
+ nxagentFBTrap = True;
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
pGC = nxagentGetGraphicContext(pDrawable);
@@ -894,7 +894,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (owner != NULL)
{
- if (nxagentOption(Shadow) == 1 &&
+ if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE))
{
@@ -945,15 +945,15 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentSynchronizeRegionStop:
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
- nxagentFBTrap = 0;
+ nxagentFBTrap = False;
nxagentGCTrap = saveTrap;
success = 1;
- if (nxagentOption(Shadow) == 0)
+ if (!nxagentOption(Shadow))
{
if (nxagentSynchronization.abort == 1)
{
@@ -1025,7 +1025,7 @@ nxagentSynchronizeRegionStop:
w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1;
h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1;
- if (nxagentOption(Shadow) == 1 &&
+ if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE))
{
@@ -2633,7 +2633,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
saveTrap = nxagentGCTrap;
- nxagentGCTrap = 1;
+ nxagentGCTrap = True;
if (nxagentDrawableStatus(pDrawable) == Synchronized)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 5281b4b5c..81d6c9864 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -583,13 +583,13 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentChangeOption(DesktopResize, !desktopResize);
- if (nxagentOption(DesktopResize) == 0)
+ if (!nxagentOption(DesktopResize))
{
fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n");
nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE);
- if (nxagentOption(Fullscreen) == 0)
+ if (!nxagentOption(Fullscreen))
{
nxagentSetWMNormalHintsMaxsize(pScreen,
nxagentOption(RootWidth),
@@ -621,7 +621,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
nxagentChangeOption(DesktopResize, !desktopResize);
- if (nxagentOption(DesktopResize) == 0)
+ if (!nxagentOption(DesktopResize))
{
nxagentShadowSetRatio(1.0, 1.0);
@@ -1048,7 +1048,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
}
case doSwitchResizeMode:
{
- if (nxagentOption(Shadow) == 0)
+ if (!nxagentOption(Shadow))
{
if (nxagentNoDialogIsRunning)
{
@@ -1096,7 +1096,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentRemoveDuplicatedKeys(&X);
}
- if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing)
+ if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && result == doNothing)
{
X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode);
@@ -1147,17 +1147,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was
{
if (X.xkey.keycode == nxagentCapsLockKeycode)
{
- nxagentXkbCapsTrap = 1;
+ nxagentXkbCapsTrap = True;
}
else if (X.xkey.keycode == nxagentNumLockKeycode)
{
- nxagentXkbNumTrap = 1;
+ nxagentXkbNumTrap = True;
}
nxagentInitXkbKeyboardState();
- nxagentXkbCapsTrap = 0;
- nxagentXkbNumTrap = 0;
+ nxagentXkbCapsTrap = False;
+ nxagentXkbNumTrap = False;
}
memset(&x, 0, sizeof(xEvent));
@@ -1181,7 +1181,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
CriticalOutputPending = 1;
- if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow))
+ if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{
X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode);
@@ -1204,7 +1204,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if (nxagentOption(Fullscreen))
{
- if ( (nxagentOption(MagicPixel) == 1) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) )
+ if ( nxagentOption(MagicPixel) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) )
{
pScreen = nxagentScreen(X.xbutton.window);
@@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
closeSession = TRUE;
}
- if (nxagentOption(DesktopResize) == False &&
+ if (!nxagentOption(DesktopResize) &&
(X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask))
{
/*
@@ -1275,7 +1275,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
CriticalOutputPending = 1;
}
- if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow))
+ if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{
X.xbutton.x -= nxagentOption(RootX);
X.xbutton.y -= nxagentOption(RootY);
@@ -1349,7 +1349,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
CriticalOutputPending = 1;
}
- if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow))
+ if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{
X.xbutton.x -= nxagentOption(RootX);
X.xbutton.y -= nxagentOption(RootY);
@@ -1410,7 +1410,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
(nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) &&
X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x +
(nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) &&
- nxagentOption(Menu) == 1)
+ nxagentOption(Menu))
{
nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id);
}
@@ -1464,7 +1464,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
viewportLastY = X.xmotion.y;
}
- if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) && !viewportCursor)
+ if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && !viewportCursor)
{
X.xmotion.x -= nxagentOption(RootX);
X.xmotion.y -= nxagentOption(RootY);
@@ -1482,7 +1482,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
NXShadowEvent(nxagentDisplay, X);
}
- if (nxagentOption(Shadow) == 0)
+ if (!nxagentOption(Shadow))
{
nxagentInputEvent = 1;
}
@@ -1575,7 +1575,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
x.u.u.detail = i * 8 + k;
x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis();
- if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow))
+ if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{
xM.type = KeyRelease;
xM.xkey.display = nxagentDisplay;
@@ -1672,14 +1672,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was
mask = CWX | CWY;
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
ConfigureWindow(pWin, mask, (XID *) values, pClient);
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
}
- if (nxagentOption(Fullscreen) == 1 &&
+ if (nxagentOption(Fullscreen) &&
X.xcrossing.window == nxagentFullscreenWindow &&
X.xcrossing.detail != NotifyInferior)
{
@@ -1803,7 +1803,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
{
int value = X.xvisibility.state;
- if (nxagentOption(Rootless) == 1)
+ if (nxagentOption(Rootless))
{
TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value);
}
@@ -1970,22 +1970,22 @@ FIXME: Don't enqueue the KeyRelease event if the key was
fprintf(stderr, "nxagentDispatchEvents: Going to handle new UnmapNotify event.\n");
#endif
- if (nxagentOption(Rootless) == 1)
+ if (nxagentOption(Rootless))
{
if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL ||
((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL &&
nxagentWindowTopLevel(pWin) == 1))
{
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
UnmapWindow(pWin, False);
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
}
}
- if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 &&
- nxagentOption(Nested) == 0 &&
+ if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) &&
+ !nxagentOption(Nested) &&
X.xmap.window != nxagentIconWindow)
{
nxagentVisibility = VisibilityFullyObscured;
@@ -2002,7 +2002,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
fprintf(stderr, "nxagentDispatchEvents: Going to handle new MapNotify event.\n");
#endif
- if (nxagentOption(Rootless) == 1)
+ if (nxagentOption(Rootless))
{
Bool value = 1;
@@ -2012,11 +2012,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was
{
pClient = wClient(pWin);
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
MapWindow(pWin, pClient);
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
}
if (pWin != NULL)
@@ -2025,7 +2025,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
}
}
- if (nxagentOption(AllScreens) == 1)
+ if (nxagentOption(AllScreens))
{
if (X.xmap.window == nxagentIconWindow)
{
@@ -2034,7 +2034,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
}
}
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
nxagentVisibility = VisibilityUnobscured;
nxagentVisibilityStop = False;
@@ -2155,7 +2155,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if (switchFullscreen)
{
- if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(AllScreens) && nxagentOption(Fullscreen))
{
nxagentSwitchAllScreens(pScreen, 0);
}
@@ -2167,7 +2167,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if (switchAllScreens)
{
- if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1)
+ if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen))
{
nxagentSwitchFullscreen(pScreen, 0);
}
@@ -2310,17 +2310,17 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
{
if (X -> xkey.keycode == nxagentCapsLockKeycode)
{
- nxagentXkbCapsTrap = 1;
+ nxagentXkbCapsTrap = True;
}
else if (X -> xkey.keycode == nxagentNumLockKeycode)
{
- nxagentXkbNumTrap = 1;
+ nxagentXkbNumTrap = True;
}
nxagentInitXkbKeyboardState();
- nxagentXkbCapsTrap = 0;
- nxagentXkbNumTrap = 0;
+ nxagentXkbCapsTrap = False;
+ nxagentXkbNumTrap = False;
}
if (nxagentCheckSpecialKeystroke(&X -> xkey, result))
@@ -3208,7 +3208,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X)
int nxagentHandleConfigureNotify(XEvent* X)
{
- if (nxagentOption(Rootless) == True)
+ if (nxagentOption(Rootless))
{
ClientPtr pClient;
WindowPtr pWinWindow;
@@ -3281,11 +3281,11 @@ int nxagentHandleConfigureNotify(XEvent* X)
mask |= CWHeight | CWWidth | CWBorderWidth;
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
ConfigureWindow(pWinWindow, mask, (XID *) values, pClient);
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
nxagentCheckWindowConfiguration((XConfigureEvent*)X);
@@ -3358,7 +3358,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum])
{
- if (nxagentOption(AllScreens) == 0)
+ if (!nxagentOption(AllScreens))
{
/*
* - WITHOUT window manager any position change is relevant
@@ -3370,7 +3370,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
int newX = X -> xconfigure.x;
int newY = X -> xconfigure.y;
- if (nxagentOption(DesktopResize) == 1)
+ if (nxagentOption(DesktopResize))
{
if (nxagentOption(Width) != X -> xconfigure.width ||
nxagentOption(Height) != X -> xconfigure.height ||
@@ -3434,7 +3434,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentChangeOption(Y, newY);
}
- if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 &&
+ if (nxagentOption(Shadow) && nxagentOption(DesktopResize) &&
(nxagentOption(Width) != X -> xconfigure.width ||
nxagentOption(Height) != X -> xconfigure.height))
{
@@ -3454,7 +3454,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
/* if in shadowing mode or if neither size nor position have
changed we do not need to adjust RandR */
/* FIXME: Comment makes no sense */
- if (nxagentOption(Shadow) == 1 ||
+ if (nxagentOption(Shadow) ||
(nxagentOption(Width) == nxagentOption(RootWidth) &&
nxagentOption(Height) == nxagentOption(RootHeight) &&
nxagentOption(X) == nxagentOption(RootX) &&
@@ -3469,7 +3469,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0,
X -> xconfigure.width, X -> xconfigure.height);
- if (nxagentOption(Fullscreen) == 0)
+ if (!nxagentOption(Fullscreen))
{
nxagentMoveViewport(pScreen, 0, 0);
}
@@ -3639,7 +3639,7 @@ int nxagentHandleReparentNotify(XEvent* X)
return 1;
}
- else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 &&
+ else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) &&
nxagentOption(WMBorderWidth) == -1)
{
XlibWindow w;
@@ -4415,7 +4415,7 @@ int nxagentUserInput(void *p)
* tus.
*/
- if (nxagentOption(Shadow) == 1 &&
+ if (nxagentOption(Shadow) &&
nxagentPendingEvents(nxagentDisplay) > 0)
{
nxagentDispatchEvents(NULL);
@@ -4436,7 +4436,7 @@ int nxagentUserInput(void *p)
* order to update the screen smoothly.
*/
- if (nxagentOption(Shadow) == 1)
+ if (nxagentOption(Shadow))
{
return result;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
index 785724cea..168191028 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
@@ -396,7 +396,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
{
if (width == 0)
{
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
@@ -408,7 +408,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
if (height == 0)
{
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
@@ -420,7 +420,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height);
- if (nxagentOption(Rootless) == 0)
+ if (!nxagentOption(Rootless))
{
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width,
height);
@@ -434,8 +434,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
UpdateCurrentTime();
- if (nxagentOption(DesktopResize) == 1 &&
- (nxagentOption(Fullscreen) == 1 ||
+ if (nxagentOption(DesktopResize) &&
+ (nxagentOption(Fullscreen) ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
{
@@ -446,8 +446,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
}
}
- if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 &&
- nxagentOption(AllScreens) == 0)
+ if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) &&
+ !nxagentOption(AllScreens))
{
nxagentChangeOption(Width, width);
nxagentChangeOption(Height, height);
@@ -455,8 +455,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight);
- if (result == 1 && nxagentOption(DesktopResize) == 1 &&
- nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)
+ if (result == 1 && nxagentOption(DesktopResize) &&
+ !nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{
nxagentRandRSetWindowsSize(width, height);
nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c
index 2fac2f100..2facc7227 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GC.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c
@@ -385,7 +385,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
else
{
if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized &&
- nxagentGCTrap == 0)
+ !nxagentGCTrap)
{
/*
* If the tile is corrupted and is not too
@@ -437,7 +437,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
if (mask & GCStipple)
{
if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized &&
- nxagentGCTrap == 0)
+ !nxagentGCTrap)
{
#ifdef TEST
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)
{
mask &= ~GCDashList;
- if (nxagentGCTrap == 0)
+ if (!nxagentGCTrap)
{
XSetDashes(nxagentDisplay, nxagentGC(pGC),
pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
@@ -549,7 +549,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
changeFlag += nxagentTestGC(values.arc_mode, arc_mode);
}
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
#ifdef TEST
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)
{
case CT_NONE:
{
- if (clipsMatch == 0 && nxagentGCTrap == 0)
+ if (clipsMatch == 0 && !nxagentGCTrap)
{
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
}
@@ -677,7 +677,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_REGION:
{
- if (clipsMatch == 0 && nxagentGCTrap == 0)
+ if (clipsMatch == 0 && !nxagentGCTrap)
{
nRects = RegionNumRects((RegionPtr)pValue);
size = nRects * sizeof(*pRects);
@@ -701,7 +701,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_PIXMAP:
{
- if (nxagentGCTrap == 0)
+ if (!nxagentGCTrap)
{
XSetClipMask(nxagentDisplay, nxagentGC(pGC),
nxagentPixmap((PixmapPtr)pValue));
@@ -719,7 +719,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_UNSORTED:
{
- if (clipsMatch == 0 && nxagentGCTrap == 0)
+ if (clipsMatch == 0 && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
@@ -730,7 +730,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_YSORTED:
{
- if (clipsMatch == 0 && nxagentGCTrap == 0)
+ if (clipsMatch == 0 && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
@@ -741,7 +741,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_YXSORTED:
{
- if (clipsMatch == 0 && nxagentGCTrap == 0)
+ if (clipsMatch == 0 && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
@@ -752,7 +752,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_YXBANDED:
{
- if (clipsMatch == 0 && nxagentGCTrap == 0)
+ if (clipsMatch == 0 && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
@@ -809,7 +809,7 @@ void nxagentDestroyClip(GCPtr pGC)
nxagentDestroyClipHelper(pGC);
- if (nxagentGCTrap == 0)
+ if (!nxagentGCTrap)
{
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
}
@@ -1453,7 +1453,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen)
nxagentSaveGCTrap = nxagentGCTrap;
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
pGC = GetScratchGC(depth, pScreen);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
index beb9ef05f..0617e73ac 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
@@ -80,7 +80,7 @@ static int nxagentSaveGCTrap;
{ \
nxagentSaveGCTrap = nxagentGCTrap;\
\
- nxagentGCTrap = 1; \
+ nxagentGCTrap = True; \
}
#define RESET_GC_TRAP() \
@@ -696,7 +696,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
}
- if (nxagentGCTrap == 1 || nxagentShmTrap == 1)
+ if (nxagentGCTrap || nxagentShmTrap)
{
if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
pDstDrawable -> type == DRAWABLE_PIXMAP)
@@ -730,7 +730,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
* 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 ||
(nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0)))
{
@@ -934,7 +934,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
(void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height);
#endif
- if (nxagentGCTrap == 1 || nxagentShmTrap == 1)
+ if (nxagentGCTrap || nxagentShmTrap)
{
if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
pDstDrawable -> type == DRAWABLE_PIXMAP)
@@ -1118,7 +1118,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
(void *) pDrawable, (void *) pGC, nPoints);
#endif
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1175,7 +1175,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode,
int nPoints, xPoint *pPoints)
{
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1248,7 +1248,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC,
#endif
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1325,7 +1325,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
#endif
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1390,7 +1390,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC,
int nArcs, xArc *pArcs)
{
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1449,7 +1449,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
{
xPoint *newPoints = NULL;
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1571,7 +1571,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
#endif
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1719,7 +1719,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
int nArcs, xArc *pArcs)
{
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1798,7 +1798,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x,
width = XTextWidth(nxagentFontStruct(pGC->font), string, count);
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1871,7 +1871,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x,
width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count);
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1930,7 +1930,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x,
void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, char *string)
{
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
@@ -1987,7 +1987,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x,
void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, unsigned short *string)
{
- if (nxagentGCTrap == 1)
+ if (nxagentGCTrap)
{
if ((pDrawable)->type == DRAWABLE_PIXMAP)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
index c9aea9cdd..af45bce02 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
@@ -680,7 +680,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
* the session.
*/
- if (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)
+ if (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)
{
#ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c
index a5e19724b..c022ebde7 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Image.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c
@@ -428,7 +428,7 @@ FIXME: Here the split trap is always set and so the caching of
resource, nxagentSplitTrap);
#endif
- if (nxagentSplitTrap == 1 || nxagentUnpackAlpha[resource] == NULL ||
+ if (nxagentSplitTrap || nxagentUnpackAlpha[resource] == NULL ||
nxagentUnpackAlpha[resource] -> size != size ||
memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0)
{
@@ -584,8 +584,8 @@ FIXME: Should use these.
int framebuffer = 1;
int realize = 1;
*/
- if (nxagentGCTrap == 1 && nxagentReconnectTrap == 0 &&
- nxagentFBTrap == 0 && nxagentShmTrap == 0)
+ if (nxagentGCTrap && !nxagentReconnectTrap &&
+ !nxagentFBTrap && !nxagentShmTrap)
{
if (pDrawable -> type == DRAWABLE_PIXMAP)
{
@@ -601,11 +601,10 @@ FIXME: Should use these.
goto nxagentPutImageEnd;
}
- if (nxagentReconnectTrap == 0 &&
- nxagentSplitTrap == 0)
+ if (!nxagentReconnectTrap && !nxagentSplitTrap)
{
if (pDrawable -> type == DRAWABLE_PIXMAP &&
- nxagentFBTrap == 0 && nxagentShmTrap == 0)
+ !nxagentFBTrap && !nxagentShmTrap)
{
fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth,
dstX, dstY, dstWidth, dstHeight, leftPad, format, data);
@@ -693,11 +692,11 @@ FIXME: Should use these.
/*
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_LAN
*/
- split = (nxagentOption(Streaming) == 1 &&
+ split = (nxagentOption(Streaming) &&
nxagentOption(LinkType) != LINK_TYPE_NONE
/*
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.
- && nxagentGlxTrap == 0
- && nxagentXvTrap == 0
+ && !nxagentGlxTrap
+ && !nxagentXvTrap
*/
);
@@ -720,12 +719,11 @@ FIXME: Temporarily stream the GLX data.
* is less than 15.
*/
- if (split == 1 && (nxagentSplitTrap == 1 || depth < 15))
+ if (split == 1 && (nxagentSplitTrap || depth < 15))
{
#ifdef TEST
- if (nxagentSplitTrap == 1 ||
- nxagentReconnectTrap == 1)
+ if (nxagentSplitTrap || nxagentReconnectTrap)
{
fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] "
"depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth);
@@ -767,7 +765,7 @@ FIXME: Temporarily stream the GLX data.
*/
if (nxagentOption(LinkType) != LINK_TYPE_NONE &&
- (nxagentGlxTrap == 1 || nxagentXvTrap == 1))
+ (nxagentGlxTrap || nxagentXvTrap))
{
#ifdef TEST
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,
bytesPerLine = nxagentImagePad(w, format, leftPad, depth);
- if (nxagentOption(Shadow) == 1 && format == ZPixmap &&
+ if (nxagentOption(Shadow) && format == ZPixmap &&
(nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE) &&
pDrawable == (DrawablePtr) nxagentShadowPixmapPtr)
@@ -1197,7 +1195,7 @@ FIXME: Should use an unpack resource here.
if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT ||
nxagentImageLength(w, h, format, leftPad, depth) <=
- IMAGE_PACK_LENGTH || nxagentLosslessTrap == 1)
+ IMAGE_PACK_LENGTH || nxagentLosslessTrap)
{
if (nxagentPackLossless == PACK_NONE)
{
@@ -1273,8 +1271,8 @@ FIXME: Should try to locate the image anyway, if the lossless
again using the preferred method.
*/
if (nxagentNeedCache(plainImage, packMethod) &&
- nxagentGlxTrap == 0 && nxagentXvTrap == 0 &&
- nxagentLosslessTrap == 0 && NXImageCacheSize > 0)
+ !nxagentGlxTrap && !nxagentXvTrap &&
+ !nxagentLosslessTrap && NXImageCacheSize > 0)
{
/*
* Be sure that the padding bits are
@@ -1341,7 +1339,7 @@ FIXME: There should be a callback registered by the agent that
* compress better.
*/
- if (lossless == 0 && nxagentOption(Adaptive) == 1)
+ if (lossless == 0 && nxagentOption(Adaptive))
{
int ratio = nxagentUniquePixels(plainImage);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index af27c6e28..4f1349ced 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -753,7 +753,7 @@ XkbError:
fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL");
#endif
- if (nxagentX2go == 1 && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0))
+ if (nxagentX2go && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0))
{
#ifdef TEST
fprintf(stderr, "%s: changing nxagentKeyboard from [null/null] to [clone].\n", __func__);
@@ -873,7 +873,7 @@ XkbError:
* instead of a file. Which is achieved by passing NULL to
* nxagentWriteKeyboardFile.
*/
- if (nxagentX2go == 1)
+ if (nxagentX2go)
nxagentWriteKeyboardDir();
}
else
@@ -891,7 +891,7 @@ XkbError:
* know about that yet. Once x2go starts using clone
* we can drop this here.
*/
- if (nxagentX2go == 1)
+ if (nxagentX2go)
nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions);
}
}
@@ -935,7 +935,7 @@ XkbError:
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
}
- if (nxagentOption(Shadow) == 1 && pDev && pDev->key)
+ if (nxagentOption(Shadow) && pDev && pDev->key)
{
NXShadowInitKeymap(&(pDev->key->curKeySyms));
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index 22d5f191e..279b73012 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -326,7 +326,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
clientReady[0] = 0;
- if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0))
+ if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0))
{
#ifdef TEST
fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n",
@@ -339,7 +339,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if (serverGeneration > nxagentMaxAllowedResets &&
nxagentSessionState == SESSION_STARTING &&
- (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1))
+ (!nxagentOption(Xdmcp) || nxagentXdmcpUp == 1))
{
#ifdef NX_DEBUG_INPUT
fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n",
@@ -568,7 +568,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString());
}
- if (nxagentOption(Shadow) == 1)
+ if (nxagentOption(Shadow))
{
NXShadowDestroy();
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
index 370fff6b5..ed2e1d836 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
@@ -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
@@ -245,7 +245,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse)
#ifdef NXAGENT_SERVER
- if (nxagentOption(Rootless) == 1)
+ if (nxagentOption(Rootless))
{
XUngrabPointer(nxagentDisplay, CurrentTime);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
index 9d0f4f719..3538191a1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
@@ -116,7 +116,7 @@ static int __glXDispatch(ClientPtr client)
* dispatching a GLX operation.
*/
- nxagentGlxTrap = 1;
+ nxagentGlxTrap = True;
#ifdef TEST
fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n",
@@ -125,7 +125,7 @@ static int __glXDispatch(ClientPtr client)
retval = (*proc)(cl, (GLbyte *) stuff);
- nxagentGlxTrap = 0;
+ nxagentGlxTrap = False;
#ifdef TEST
fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
index 9d8a46c4f..dd432ff39 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
@@ -189,7 +189,7 @@ ProcChangeProperty(ClientPtr client)
return err;
else
{
- if (nxagentOption(Rootless) == 1)
+ if (nxagentOption(Rootless))
{
nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format,
(int) mode, len, (void *) &stuff[1]);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index ce4ea9d5f..f7bf50028 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
@@ -1683,11 +1683,11 @@ ProcRenderDispatch (ClientPtr client)
* avoid reentrancy in GCOps.c.
*/
- nxagentGCTrap = 1;
+ nxagentGCTrap = True;
result = (*ProcRenderVector[stuff->data]) (client);
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
return result;
}
@@ -1720,11 +1720,11 @@ SProcRenderDispatch (ClientPtr client)
* avoid reentrancy in GCOps.c.
*/
- nxagentGCTrap = 1;
+ nxagentGCTrap = True;
result = (*SProcRenderVector[stuff->data]) (client);
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
return result;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index 246d39355..6ce2e48e8 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -96,7 +96,7 @@ ShmExtensionInit(void)
#endif
#ifdef NXAGENT_SERVER
- if (nxagentOption(SharedMemory) == False)
+ if (!nxagentOption(SharedMemory))
{
return;
}
@@ -207,11 +207,11 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
{
/* 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);
- nxagentShmTrap = 1;
+ nxagentShmTrap = True;
return;
}
@@ -476,11 +476,11 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
{
PixmapPtr result;
- nxagentShmPixmapTrap = 1;
+ nxagentShmPixmapTrap = True;
result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr);
- nxagentShmPixmapTrap = 0;
+ nxagentShmPixmapTrap = False;
return result;
}
@@ -553,11 +553,11 @@ ProcShmDispatch (register ClientPtr client)
{
int result;
- nxagentShmTrap = 1;
+ nxagentShmTrap = True;
result = nxagent_ProcShmDispatch(client);
- nxagentShmTrap = 0;
+ nxagentShmTrap = False;
return result;
}
@@ -591,13 +591,13 @@ SProcShmDispatch (client)
#endif
#ifdef NXAGENT_SERVER
- nxagentShmTrap = 1;
+ nxagentShmTrap = True;
#endif
result = SProcShmPutImage(client);
#ifdef NXAGENT_SERVER
- nxagentShmTrap = 0;
+ nxagentShmTrap = False;
#endif
#ifdef TEST
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
index 64bbf67c4..653bfb399 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
@@ -561,7 +561,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) &&
pWin -> overrideRedirect == 0 &&
- nxagentScreenTrap == 0)
+ !nxagentScreenTrap)
{
nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
index 336ec1060..db4802c7c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
@@ -162,11 +162,11 @@ ProcXvDispatch(ClientPtr client)
stuff->data, client -> index);
#endif
- nxagentXvTrap = 1;
+ nxagentXvTrap = True;
result = nxagent_ProcXvDispatch(client);
- nxagentXvTrap = 0;
+ nxagentXvTrap = False;
#ifdef TEST
fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n",
@@ -239,11 +239,11 @@ SProcXvDispatch(ClientPtr client)
stuff->data, client -> index);
#endif
- nxagentXvTrap = 1;
+ nxagentXvTrap = True;
result = nxagent_SProcXvDispatch(client);
- nxagentXvTrap = 0;
+ nxagentXvTrap = False;
#ifdef TEST
fprintf(stderr, "SProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h
index 316d147ac..64a7f8658 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h
@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
- (nxagentSplitTrap == 0 && \
+ (!nxagentSplitTrap && \
nxagentOption(DeferLevel) > 0)
/*
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
index be154f9c2..3deedda42 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
@@ -217,7 +217,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
* id of the drawable in the checksum.
*/
- if (width != 0 && height != 0 && nxagentGCTrap == 0)
+ if (width != 0 && height != 0 && !nxagentGCTrap)
{
pPixmapPriv -> id = XCreatePixmap(nxagentDisplay,
nxagentDefaultWindows[pScreen -> myNum],
@@ -348,7 +348,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
fprintf(stderr, "Warning: Disabling render extension due to missing pixmap format.\n");
#endif
- nxagentRenderTrap = 1;
+ nxagentRenderTrap = True;
}
nxagentDestroyPixmap(pPixmap);
@@ -923,11 +923,11 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2)
return;
}
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
*pBool = nxagentSynchronizeDrawableData((DrawablePtr) pPixmap, NEVER_BREAK, NULL);
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
if (!*pBool)
{
@@ -1256,11 +1256,11 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
saveTrap = nxagentGCTrap;
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
- nxagentFBTrap = 1;
+ nxagentFBTrap = True;
if ((data = malloc(length)) != NULL)
{
@@ -1281,9 +1281,9 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentGCTrap = saveTrap;
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
- nxagentFBTrap = 0;
+ nxagentFBTrap = False;
nxagentFreeScratchGC(pGC);
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
index c59230724..124fdddc7 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c
@@ -85,7 +85,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
* window.
*/
- if (nxagentOption(DeviceControl) == True)
+ if (nxagentOption(DeviceControl))
{
#ifdef TEST
fprintf(stderr, "nxagentChangePointerControl: WARNING! Propagating changes to pointer settings.\n");
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
index a921df6ca..f7e585a79 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
@@ -240,7 +240,7 @@ TODO: This should be reset only when
*/
nxagentException.ioError = 0;
- if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING)
+ if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING)
{
if (nxagentSessionState == SESSION_UP)
{
@@ -338,7 +338,7 @@ void nxagentInitializeRecLossyLevel(void)
void nxagentInitReconnector(void)
{
- nxagentReconnectTrap = 0;
+ nxagentReconnectTrap = False;
reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int));
reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int));
@@ -608,8 +608,8 @@ Bool nxagentReconnectSession(void)
nxagentOldKeyboard = NULL;
}
- if (nxagentOption(ResetKeyboardAtResume) == 1 &&
- (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
+ if (nxagentOption(ResetKeyboardAtResume) &&
+ (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
strcmp(nxagentKeyboard, "query") == 0 ||
strcmp(nxagentKeyboard, "clone") == 0))
@@ -648,7 +648,7 @@ Bool nxagentReconnectSession(void)
nxagentRedirectDefaultWindows();
- if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True)
+ if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama))
{
nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
index 9d91b1ff1..84c81a3f8 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c
@@ -569,11 +569,11 @@ int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
nxagentMarkCorruptedRegion(pPicture -> pDrawable, NULL);
- nxagentLosslessTrap = 1;
+ nxagentLosslessTrap = True;
nxagentSynchronizeDrawable(pPicture -> pDrawable, DO_WAIT, NEVER_BREAK, NULL);
- nxagentLosslessTrap = 0;
+ nxagentLosslessTrap = False;
cid = XRenderCreateCursor(nxagentDisplay, nxagentPicture(pPicture), x, y);
@@ -2741,7 +2741,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2)
int i;
- if (nxagentReconnectTrap == 0)
+ if (!nxagentReconnectTrap)
{
#ifdef DEBUG
fprintf(stderr, "nxagentReconnectGlyphSet: GlyphSet at [%p].\n", (void *) pGly);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
index 82ec14fe9..f28acf905 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
@@ -373,9 +373,9 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
mask = CWSibling | CWStackMode;
values[0] = pWin -> drawable.id;
pClient = wClient(toplevel[ntoplevel]);
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
ConfigureWindow(toplevel[ntoplevel], mask, (XID *) values, pClient);
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
#ifdef TEST
fprintf(stderr, "nxagentRootlessRestack: Restacked window [%p].\n", (void*) toplevel[ntoplevel]);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 19057dfe1..ac9d6cc75 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -596,7 +596,7 @@ FIXME: Do we need to check the key grab if the
raise(SIGTERM);
}
- else if (nxagentOption(Persistent) == 0)
+ else if (!nxagentOption(Persistent))
{
fprintf(stderr, "Info: Terminating session with persistence not allowed.\n");
@@ -871,7 +871,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
pScreen->myNum);
#endif
- if (nxagentRenderEnable && nxagentReconnectTrap == False)
+ if (nxagentRenderEnable && !nxagentReconnectTrap)
{
PictureScreenPrivateIndex = -1;
}
@@ -885,10 +885,10 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
#endif
/*
- * Forced geometry parameter to user geometry.
+ * Force geometry parameter to user geometry except if in rootless mode.
*/
- if (nxagentResizeDesktopAtStartup)
+ if (nxagentResizeDesktopAtStartup && !nxagentOption(Rootless))
{
if (nxagentUserGeometry.flag & XValue)
{
@@ -922,9 +922,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
/*
* This is first time the screen is initialized.
* Filling the geometry parameter from user geometry.
+ * we do not need this in rootless mode since we ignore
+ * user geometry then.
*/
- if (nxagentReconnectTrap == False)
+ if (!nxagentReconnectTrap && !nxagentOption(Rootless))
{
if (nxagentUserGeometry.flag & XValue)
{
@@ -968,7 +970,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* the screen if we are either in rootless or in fullscreen mode.
*/
- if (nxagentOption(Rootless) == False && !nxagentWMIsRunning)
+ if (!nxagentOption(Rootless) && !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n");
@@ -977,7 +979,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(Fullscreen, True);
if (nxagentOption(ClientOs) == ClientOsWinnt &&
- (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup))
+ (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup))
{
NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
}
@@ -986,7 +988,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if (nxagentOption(Fullscreen) &&
nxagentWMIsRunning &&
nxagentReconnectTrap &&
- nxagentResizeDesktopAtStartup == False &&
+ !nxagentResizeDesktopAtStartup &&
nxagentXServerGeometryChanged())
{
#ifdef TEST
@@ -1017,7 +1019,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(Height, h);
/* first time screen initialization or resize during reconnect */
- if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)
+ if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)
{
if (nxagentOption(RootWidth) >= w)
{
@@ -1050,13 +1052,27 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(RootY, (h - nxagentOption(RootHeight)) / 2);
}
}
- else
+ else if (nxagentOption(Rootless))
{
+ nxagentChangeOption(X, 0);
+ nxagentChangeOption(Y, 0);
+
+ nxagentChangeOption(RootX, 0);
+ nxagentChangeOption(RootY, 0);
+
+ nxagentChangeOption(RootWidth, w);
+ nxagentChangeOption(RootHeight, h);
+
+ nxagentChangeOption(Width, w);
+ nxagentChangeOption(Height, h);
+ }
+ else /* window mode */
+ {
/*
- * screen is initialized for the first time
+ * screen is initialized for the first time.
*/
- if (nxagentReconnectTrap == False)
+ if (!nxagentReconnectTrap)
{
nxagentChangeOption(RootX, 0);
nxagentChangeOption(RootY, 0);
@@ -1080,26 +1096,12 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if (nxagentOption(Width) > w)
{
- if (nxagentOption(Rootless))
- {
- nxagentChangeOption(Width, w);
- }
- else
- {
- nxagentChangeOption(Width, w * 3 / 4);
- }
+ nxagentChangeOption(Width, w * 3 / 4);
}
if (nxagentOption(Height) > h)
{
- if (nxagentOption(Rootless))
- {
- nxagentChangeOption(Height, h);
- }
- else
- {
- nxagentChangeOption(Height, h * 3 / 4);
- }
+ nxagentChangeOption(Height, h * 3 / 4);
}
/*
@@ -1109,7 +1111,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* the root window isn't bigger than the X server root window..
*/
- if (nxagentReconnectTrap == False)
+ if (!nxagentReconnectTrap)
{
if ((nxagentOption(RootWidth) < w) &&
!(nxagentUserGeometry.flag & WidthValue))
@@ -1135,19 +1137,13 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(SavedHeight, nxagentOption(RootHeight));
}
- if (nxagentOption(Rootless))
- {
- nxagentChangeOption(RootWidth, w);
- nxagentChangeOption(RootHeight, h);
- }
-
nxagentChangeOption(SavedRootWidth, nxagentOption(RootWidth));
nxagentChangeOption(SavedRootHeight, nxagentOption(RootHeight));
nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth));
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight));
- if (nxagentReconnectTrap == 0)
+ if (!nxagentReconnectTrap)
{
if (nxagentOption(Persistent))
{
@@ -1348,11 +1344,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
rootDepth, (long unsigned int)defaultVisual);
#endif
- if ((monitorResolution < 1) && (nxagentAutoDPI == False))
+ if ((monitorResolution < 1) && !nxagentAutoDPI)
{
monitorResolution = NXAGENT_DEFAULT_DPI;
}
- else if ((monitorResolution < 1) && (nxagentAutoDPI == True))
+ else if ((monitorResolution < 1) && nxagentAutoDPI)
{
monitorResolution = NXAGENT_AUTO_DPI;
}
@@ -1703,21 +1699,21 @@ N/A
#endif
if (nxagentDoFullGeneration == 1 ||
- nxagentReconnectTrap == 1)
+ nxagentReconnectTrap)
{
valuemask = CWBackPixel | CWEventMask | CWColormap |
- (nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0);
+ (nxagentOption(AllScreens) ? CWOverrideRedirect : 0);
attributes.background_pixel = nxagentBlackPixel;
attributes.event_mask = nxagentGetDefaultEventMask();
attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen));
- if (nxagentOption(AllScreens) == 1)
+ if (nxagentOption(AllScreens))
{
attributes.override_redirect = True;
}
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
if (nxagentReconnectTrap)
{
@@ -1753,7 +1749,7 @@ N/A
* handling the splash screen.
*/
- if (nxagentOption(Rootless) == True)
+ if (nxagentOption(Rootless))
{
nxagentDefaultWindows[pScreen->myNum] = DefaultRootWindow(nxagentDisplay);
@@ -1780,7 +1776,7 @@ N/A
nxagentDefaultVisual(pScreen),
valuemask, &attributes);
- if (nxagentOption(Rootless) == 0)
+ if (!nxagentOption(Rootless))
{
valuemask = CWEventMask;
mask = PointerMotionMask;
@@ -1888,7 +1884,7 @@ N/A
sizeHints->width = nxagentOption(RootWidth);
sizeHints->height = nxagentOption(RootHeight);
- if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen))
{
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
@@ -2004,7 +2000,7 @@ N/A
/* FIXME: This doing the same thing in both cases. The
comments do not seem accurate (anymore?) */
- if (nxagentOption(Rootless) == False)
+ if (!nxagentOption(Rootless))
{
/*
* Set the WM_DELETE_WINDOW protocol for the main agent
@@ -2053,7 +2049,7 @@ N/A
* and pointer settings.
*/
- if (nxagentOption(DeviceControl) == False)
+ if (!nxagentOption(DeviceControl))
{
fprintf(stderr, "Info: Not using local device configuration changes.\n");
}
@@ -2432,13 +2428,13 @@ FIXME: We should try to restore the previously
* Change agent window size and size hints.
*/
- if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0))
+ if (!nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{
nxagentSetWMNormalHints(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);
}
@@ -2593,7 +2589,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
NXShadowSetDisplayUid(nxagentShadowUid);
}
- if (nxagentOption(UseDamage) == 0)
+ if (!nxagentOption(UseDamage))
{
NXShadowDisableDamage();
}
@@ -2638,7 +2634,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
#ifndef __CYGWIN32__
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth,
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight);
@@ -4575,7 +4571,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
sizeHints->width = width;
sizeHints->height = height;
- if (nxagentOption(DesktopResize) == 1)
+ if (nxagentOption(DesktopResize))
{
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.c b/nx-X11/programs/Xserver/hw/nxagent/Trap.c
index c582f6a16..9453d2036 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Trap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.c
@@ -31,7 +31,7 @@
* reentrancy in GC operations.
*/
-int nxagentGCTrap = 0;
+int nxagentGCTrap = False;
/*
* Set if we are enqueing an internal
@@ -39,14 +39,14 @@ int nxagentGCTrap = 0;
* Window. Used to remove any screen operation.
*/
-int nxagentScreenTrap = 0;
+int nxagentScreenTrap = False;
/*
* Set if we detected that our RENDER
* implementation is faulty.
*/
-int nxagentRenderTrap = 0;
+int nxagentRenderTrap = False;
/*
* Set if we are executing a GC operation
@@ -54,55 +54,55 @@ int nxagentRenderTrap = 0;
* reentrancy in FB layer.
*/
-int nxagentFBTrap = 0;
+int nxagentFBTrap = False;
/*
* Set if we are dispatching a shared
* memory extension request.
*/
-int nxagentShmTrap = 0;
+int nxagentShmTrap = False;
/*
* Set if a shared pixmap operation is
* requested by the client.
*/
-int nxagentShmPixmapTrap = 0;
+int nxagentShmPixmapTrap = False;
/*
* Set if we are dispatching a XVideo
* extension request.
*/
-int nxagentXvTrap = 0;
+int nxagentXvTrap = False;
/*
* Set if we are dispatching a GLX
* extension request.
*/
-int nxagentGlxTrap = 0;
+int nxagentGlxTrap = False;
/*
* Set while we are resuming the session.
*/
-int nxagentReconnectTrap = 0;
+int nxagentReconnectTrap = False;
/*
* Set if we need to realize a drawable
* by using a lossless encoding.
*/
-int nxagentLosslessTrap = 0;
+int nxagentLosslessTrap = False;
/*
* Set to force the synchronization of
* a drawable.
*/
-int nxagentSplitTrap = 0;
+int nxagentSplitTrap = False;
/*
* Set to avoid CapsLock synchronization
@@ -110,7 +110,7 @@ int nxagentSplitTrap = 0;
* key to be pressed in the session.
*/
-int nxagentXkbCapsTrap = 0;
+int nxagentXkbCapsTrap = False;
/*
* Set to avoid NumLock synchronization
@@ -118,5 +118,5 @@ int nxagentXkbCapsTrap = 0;
* key to be pressed in the session.
*/
-int nxagentXkbNumTrap = 0;
+int nxagentXkbNumTrap = False;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h
index f0884f657..1abacdaf5 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h
@@ -26,6 +26,14 @@
#ifndef __Traps_H__
#define __Traps_H__
+#ifndef True
+# define True 1
+#endif
+
+#ifndef False
+# define False 0
+#endif
+
/*
* Set if we are dispatching a render
* extension request. Used to avoid
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index c404d0a46..ce0563f25 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -397,7 +397,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin) -> corruptedTimestamp = 0;
nxagentWindowPriv(pWin) -> splitResource = NULL;
- if (nxagentOption(Rootless) == 1)
+ if (nxagentOption(Rootless))
{
if (pWin != nxagentRootlessWindow)
{
@@ -557,7 +557,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
{
nxagentPrivWindowPtr pWindowPriv;
- if (nxagentScreenTrap == 1)
+ if (nxagentScreenTrap)
{
return 1;
}
@@ -685,7 +685,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
{
- if (nxagentScreenTrap == 1)
+ if (nxagentScreenTrap)
{
return True;
}
@@ -703,7 +703,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
{
- if (nxagentScreenTrap == 1)
+ if (nxagentScreenTrap)
{
return;
}
@@ -713,7 +713,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{
- if (nxagentOption(Rootless) == 1)
+ if (nxagentOption(Rootless))
{
return;
}
@@ -908,9 +908,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w;
- if (nxagentOption(DesktopResize) == 1)
+ if (nxagentOption(DesktopResize))
{
- if (nxagentOption(Shadow) == 0)
+ if (!nxagentOption(Shadow))
{
nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)));
@@ -959,12 +959,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentIconWindow = nxagentFullscreenWindow = None;
- if (nxagentOption(DesktopResize) == 1)
+ if (nxagentOption(DesktopResize))
{
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
- if (nxagentOption(Shadow) == 0)
+ if (!nxagentOption(Shadow))
{
nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight));
@@ -985,7 +985,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight));
- if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1)
+ if (nxagentOption(Shadow) && nxagentOption(DesktopResize))
{
nxagentShadowAdaptToRatio();
}
@@ -1225,7 +1225,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x;
int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y;
- if (nxagentScreenTrap == 1)
+ if (nxagentScreenTrap)
{
#ifdef TEST
fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n");
@@ -1234,7 +1234,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
return;
}
- if (nxagentOption(Rootless) == 1 &&
+ if (nxagentOption(Rootless) &&
nxagentWindowTopLevel(pWin) == 1)
{
mask &= ~(CWSibling | CWStackMode);
@@ -1836,7 +1836,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
Bool nxagentRealizeWindow(WindowPtr pWin)
{
- if (nxagentScreenTrap == 1)
+ if (nxagentScreenTrap)
{
return True;
}
@@ -2427,7 +2427,7 @@ void nxagentRefreshWindows(WindowPtr pWin)
void nxagentUnmapWindows(void)
{
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
for (int i = 0; i < screenInfo.numScreens; i++)
{
@@ -2450,7 +2450,7 @@ void nxagentMapDefaultWindows(void)
MapWindow(pWin, serverClient);
- if (nxagentOption(Rootless) == 0)
+ if (!nxagentOption(Rootless))
{
/*
* Show the NX splash screen.
@@ -2470,7 +2470,7 @@ void nxagentMapDefaultWindows(void)
* Windows client.
*/
- if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning)
+ if (!nxagentOption(Shadow) || !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
@@ -2479,7 +2479,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
- if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning)
+ if (nxagentOption(Fullscreen) && nxagentWMIsRunning)
{
nxagentMaximizeToFullScreen(pScreen);
}
@@ -2497,7 +2497,7 @@ void nxagentMapDefaultWindows(void)
* after the Root Window is mapped.
*/
- if (nxagentReconnectTrap == 0)
+ if (!nxagentReconnectTrap)
{
XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]);
}
@@ -2693,7 +2693,7 @@ Bool nxagentReconnectAllWindows(void *p0)
* Windows is raised.
*/
- if (nxagentOption(Rootless) == 0)
+ if (!nxagentOption(Rootless))
{
for (int i = 0; i < screenInfo.numScreens; i++)
{
@@ -3196,7 +3196,7 @@ XXX: This would break Motif menus.
XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum);
}
}
- else if (nxagentOption(Rootless) == 0)
+ else if (!nxagentOption(Rootless))
{
/*
* Map the root window.
diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c
index 68d3b97e6..06265615c 100644
--- a/nx-X11/programs/Xserver/randr/rrdispatch.c
+++ b/nx-X11/programs/Xserver/randr/rrdispatch.c
@@ -64,11 +64,7 @@ ProcRRQueryVersion(ClientPtr client)
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
-#ifndef NXAGENT_SERVER
- WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
-#else
WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
-#endif
return Success;
}