Commit 2b4ccc30 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: treat several nxagentOptions as real Booleans

Adaptive, Composite, DeviceControl, DeviceControlUserDefined, IgnoreVisibility, InhibitXkb, Nested, Menu, MagicPixel, Persistent, Reset, ResetzKeyboardAtResume, SharedMemory, SharedPixmaps, Streaming, UseDamage, ViewOnly, Xdmcp, Xinerama
parent a85adf5e
...@@ -488,11 +488,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -488,11 +488,11 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{ {
if (!strcmp(argv[i], "0")) if (!strcmp(argv[i], "0"))
{ {
nxagentChangeOption(Streaming, 0); nxagentChangeOption(Streaming, False);
} }
else else
{ {
nxagentChangeOption(Streaming, 1); nxagentChangeOption(Streaming, True);
} }
return 2; return 2;
} }
...@@ -670,7 +670,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -670,7 +670,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-nomagicpixel")) if (!strcmp(argv[i], "-nomagicpixel"))
{ {
nxagentChangeOption(MagicPixel, 0); nxagentChangeOption(MagicPixel, False);
return 1; return 1;
} }
...@@ -725,13 +725,13 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -725,13 +725,13 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-nocomposite")) if (!strcmp(argv[i], "-nocomposite"))
{ {
nxagentChangeOption(Composite, 0); nxagentChangeOption(Composite, False);
return 1; return 1;
} }
if (!strcmp(argv[i], "-nodamage")) if (!strcmp(argv[i], "-nodamage"))
{ {
nxagentChangeOption(UseDamage, 0); nxagentChangeOption(UseDamage, False);
return 1; return 1;
} }
...@@ -779,7 +779,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -779,7 +779,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-noignore")) if (!strcmp(argv[i], "-noignore"))
{ {
nxagentChangeOption(DeviceControl, True); nxagentChangeOption(DeviceControl, True);
nxagentChangeOption(DeviceControlUserDefined , True); nxagentChangeOption(DeviceControlUserDefined, True);
return 1; return 1;
} }
...@@ -791,7 +791,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -791,7 +791,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-noxkblock")) if (!strcmp(argv[i], "-noxkblock"))
{ {
nxagentChangeOption(InhibitXkb, 0); nxagentChangeOption(InhibitXkb, False);
return 1; return 1;
} }
...@@ -832,7 +832,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -832,7 +832,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{ {
nxagentChangeOption(Shadow, 1); nxagentChangeOption(Shadow, 1);
nxagentChangeOption(DeferLevel, 0); nxagentChangeOption(DeferLevel, 0);
nxagentChangeOption(Persistent, 0); nxagentChangeOption(Persistent, False);
return 1; return 1;
} }
...@@ -858,11 +858,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -858,11 +858,11 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{ {
if (!strcmp(argv[i], "0")) if (!strcmp(argv[i], "0"))
{ {
nxagentChangeOption(ViewOnly, 1); nxagentChangeOption(ViewOnly, True);
} }
else else
{ {
nxagentChangeOption(ViewOnly, 0); nxagentChangeOption(ViewOnly, False);
} }
return 2; return 2;
} }
...@@ -998,7 +998,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -998,7 +998,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
* has been disabled on the cmdline. * has been disabled on the cmdline.
*/ */
if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND)
nxagentChangeOption(Xinerama, 0); nxagentChangeOption(Xinerama, False);
return 0; return 0;
} }
...@@ -1174,11 +1174,11 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1174,11 +1174,11 @@ static void nxagentParseSingleOption(char *name, char *value)
{ {
if (!strcmp(value, "1")) if (!strcmp(value, "1"))
{ {
nxagentChangeOption(Composite, 1); nxagentChangeOption(Composite, True);
} }
else if (!strcmp(value, "0")) else if (!strcmp(value, "0"))
{ {
nxagentChangeOption(Composite, 0); nxagentChangeOption(Composite, False);
} }
else else
{ {
...@@ -1190,25 +1190,25 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1190,25 +1190,25 @@ static void nxagentParseSingleOption(char *name, char *value)
else if (!strcmp(name, "xinerama")) else if (!strcmp(name, "xinerama"))
{ {
#if !defined(PANORAMIX) && !defined(RANDR) #if !defined(PANORAMIX) && !defined(RANDR)
nxagentChangeOption(Xinerama, 0); nxagentChangeOption(Xinerama, False);
fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", nxagentProgName); fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", nxagentProgName);
return; return;
#else #else
if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND)
{ {
nxagentChangeOption(Xinerama, 0); nxagentChangeOption(Xinerama, False);
fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", nxagentProgName); fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", nxagentProgName);
return; return;
} }
if (!strcmp(value, "1")) if (!strcmp(value, "1"))
{ {
nxagentChangeOption(Xinerama, 1); nxagentChangeOption(Xinerama, True);
return; return;
} }
else if (!strcmp(value, "0")) else if (!strcmp(value, "0"))
{ {
nxagentChangeOption(Xinerama, 0); nxagentChangeOption(Xinerama, False);
} }
else else
{ {
...@@ -1251,11 +1251,11 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1251,11 +1251,11 @@ static void nxagentParseSingleOption(char *name, char *value)
{ {
if (!strcmp(value, "0")) if (!strcmp(value, "0"))
{ {
nxagentChangeOption(Menu, 0); nxagentChangeOption(Menu, False);
} }
else else
{ {
nxagentChangeOption(Menu, 1); nxagentChangeOption(Menu, True);
} }
return; return;
} }
...@@ -1263,11 +1263,11 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1263,11 +1263,11 @@ static void nxagentParseSingleOption(char *name, char *value)
{ {
if (!strcmp(value, "0")) if (!strcmp(value, "0"))
{ {
nxagentChangeOption(MagicPixel, 0); nxagentChangeOption(MagicPixel, False);
} }
else else
{ {
nxagentChangeOption(MagicPixel, 1); nxagentChangeOption(MagicPixel, True);
} }
return; return;
} }
...@@ -2038,7 +2038,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2038,7 +2038,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
* We enable server reset only for indirect XDMCP sessions. * We enable server reset only for indirect 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");
...@@ -2054,7 +2054,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2054,7 +2054,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
* passing the -noreset option to a standard XFree86 server. * passing the -noreset option 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");
...@@ -2166,7 +2166,7 @@ void nxagentSetPackMethod(void) ...@@ -2166,7 +2166,7 @@ void nxagentSetPackMethod(void)
if (nxagentOption(LinkType) == LINK_TYPE_NONE) if (nxagentOption(LinkType) == LINK_TYPE_NONE)
{ {
nxagentChangeOption(Streaming, 0); nxagentChangeOption(Streaming, False);
nxagentPackMethod = PACK_NONE; nxagentPackMethod = PACK_NONE;
nxagentPackLossless = PACK_NONE; nxagentPackLossless = PACK_NONE;
...@@ -2189,7 +2189,7 @@ void nxagentSetPackMethod(void) ...@@ -2189,7 +2189,7 @@ void nxagentSetPackMethod(void)
fprintf(stderr, "nxagentSetPackMethod: Using adaptive mode for image compression.\n"); fprintf(stderr, "nxagentSetPackMethod: Using adaptive mode for image compression.\n");
#endif #endif
nxagentChangeOption(Adaptive, 1); nxagentChangeOption(Adaptive, True);
} }
else else
{ {
...@@ -2197,7 +2197,7 @@ void nxagentSetPackMethod(void) ...@@ -2197,7 +2197,7 @@ void nxagentSetPackMethod(void)
fprintf(stderr, "nxagentSetPackMethod: Not using adaptive mode for image compression.\n"); fprintf(stderr, "nxagentSetPackMethod: Not using adaptive mode for image compression.\n");
#endif #endif
nxagentChangeOption(Adaptive, 0); nxagentChangeOption(Adaptive, False);
} }
if (method == PACK_LOSSY || method == PACK_ADAPTIVE) if (method == PACK_LOSSY || method == PACK_ADAPTIVE)
...@@ -2326,11 +2326,11 @@ void nxagentSetDeferLevel(void) ...@@ -2326,11 +2326,11 @@ void nxagentSetDeferLevel(void)
* version of the agent. * version 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");
nxagentChangeOption(Streaming, 0); nxagentChangeOption(Streaming, False);
} }
switch (nxagentOption(LinkType)) switch (nxagentOption(LinkType))
......
...@@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen) ...@@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen)
* server. * server.
*/ */
nxagentChangeOption(Nested, 1); nxagentChangeOption(Nested, True);
/* /*
* Avoid the image degradation caused by * Avoid the image degradation caused by
......
...@@ -332,7 +332,7 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property) ...@@ -332,7 +332,7 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property)
* the windows updated. * the windows updated.
*/ */
nxagentChangeOption(IgnoreVisibility, 1); nxagentChangeOption(IgnoreVisibility, True);
} }
} }
} }
...@@ -373,7 +373,7 @@ static void checkIfShadowAgent(ClientPtr client) ...@@ -373,7 +373,7 @@ static void checkIfShadowAgent(ClientPtr client)
fprintf(stderr, "nxagentCheckIfShadowAgent: The last shadow nxagent has been detached.\n"); fprintf(stderr, "nxagentCheckIfShadowAgent: The last shadow nxagent has been detached.\n");
#endif #endif
nxagentChangeOption(IgnoreVisibility, 0); nxagentChangeOption(IgnoreVisibility, False);
} }
} }
} }
......
...@@ -57,7 +57,7 @@ void nxagentCompositeExtensionInit(void) ...@@ -57,7 +57,7 @@ void nxagentCompositeExtensionInit(void)
nxagentCompositeEnable = 0; nxagentCompositeEnable = 0;
if (nxagentOption(Composite) == 1) if (nxagentOption(Composite))
{ {
int eventBase, errorBase; int eventBase, errorBase;
......
...@@ -312,7 +312,7 @@ static void nxagentSighupHandler(int signal) ...@@ -312,7 +312,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");
......
...@@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) ...@@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentRemoveDuplicatedKeys(&X); nxagentRemoveDuplicatedKeys(&X);
} }
if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) == 1 && result == doNothing)
{ {
X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode);
...@@ -1190,7 +1190,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1190,7 +1190,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
CriticalOutputPending = 1; CriticalOutputPending = 1;
if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{ {
X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode);
...@@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
if (nxagentOption(Fullscreen)) 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); pScreen = nxagentScreen(X.xbutton.window);
...@@ -1285,7 +1285,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1285,7 +1285,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
CriticalOutputPending = 1; CriticalOutputPending = 1;
} }
if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{ {
X.xbutton.x -= nxagentOption(RootX); X.xbutton.x -= nxagentOption(RootX);
X.xbutton.y -= nxagentOption(RootY); X.xbutton.y -= nxagentOption(RootY);
...@@ -1359,7 +1359,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1359,7 +1359,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
CriticalOutputPending = 1; CriticalOutputPending = 1;
} }
if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{ {
X.xbutton.x -= nxagentOption(RootX); X.xbutton.x -= nxagentOption(RootX);
X.xbutton.y -= nxagentOption(RootY); X.xbutton.y -= nxagentOption(RootY);
...@@ -1420,7 +1420,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1420,7 +1420,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
(nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) &&
X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x +
(nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) &&
nxagentOption(Menu) == 1) nxagentOption(Menu))
{ {
nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id); nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id);
} }
...@@ -1474,7 +1474,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1474,7 +1474,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
viewportLastY = X.xmotion.y; viewportLastY = X.xmotion.y;
} }
if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) && !viewportCursor) if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && !viewportCursor)
{ {
X.xmotion.x -= nxagentOption(RootX); X.xmotion.x -= nxagentOption(RootX);
X.xmotion.y -= nxagentOption(RootY); X.xmotion.y -= nxagentOption(RootY);
...@@ -1609,7 +1609,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1609,7 +1609,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
x.u.u.detail = i * 8 + k; x.u.u.detail = i * 8 + k;
x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis();
if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) if (!nxagentOption(ViewOnly) && nxagentOption(Shadow))
{ {
XEvent xM = {0}; XEvent xM = {0};
xM.type = KeyRelease; xM.type = KeyRelease;
...@@ -2020,7 +2020,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2020,7 +2020,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
} }
if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 &&
nxagentOption(Nested) == 0 && !nxagentOption(Nested) &&
X.xmap.window != nxagentIconWindow) X.xmap.window != nxagentIconWindow)
{ {
nxagentVisibility = VisibilityFullyObscured; nxagentVisibility = VisibilityFullyObscured;
......
...@@ -698,7 +698,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -698,7 +698,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
* little use. * 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)))
{ {
......
...@@ -648,7 +648,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -648,7 +648,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);
......
...@@ -524,7 +524,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -524,7 +524,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
* window. * window.
*/ */
if (nxagentOption(IgnoreVisibility) == 0 && pDrawable -> type == DRAWABLE_WINDOW && if (!nxagentOption(IgnoreVisibility) && pDrawable -> type == DRAWABLE_WINDOW &&
(nxagentWindowIsVisible((WindowPtr) pDrawable) == 0 || (nxagentWindowIsVisible((WindowPtr) pDrawable) == 0 ||
(nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0)))
{ {
...@@ -667,11 +667,11 @@ FIXME: Should use these. ...@@ -667,11 +667,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, we FIXME: Do we stream the images from GLX or Xv? If we do that, we
...@@ -1284,7 +1284,7 @@ FIXME: There should be a callback registered by the agent that ...@@ -1284,7 +1284,7 @@ FIXME: There should be a callback registered by the agent that
* lossless encoder will compress better. * lossless encoder will compress better.
*/ */
if (lossless == 0 && nxagentOption(Adaptive) == 1) if (lossless == 0 && nxagentOption(Adaptive))
{ {
int ratio = nxagentUniquePixels(plainImage); int ratio = nxagentUniquePixels(plainImage);
......
...@@ -518,7 +518,7 @@ FIXME: Do we need to check the key grab if the ...@@ -518,7 +518,7 @@ FIXME: Do we need to check the key grab if the
fprintf(stderr, "Info: Auto-terminating session with no client running.\n"); fprintf(stderr, "Info: Auto-terminating session with no client running.\n");
raise(SIGTERM); raise(SIGTERM);
} }
else if (nxagentOption(Persistent) == 0) else if (!nxagentOption(Persistent))
{ {
fprintf(stderr, "Info: Auto-terminating session with persistence not allowed.\n"); fprintf(stderr, "Info: Auto-terminating session with persistence not allowed.\n");
raise(SIGTERM); raise(SIGTERM);
......
...@@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
clientReady[0] = 0; clientReady[0] = 0;
if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) if (nxagentHaveSplashWindow() || (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",
...@@ -343,7 +343,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -343,7 +343,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 [%u].\n", fprintf(stderr, "Session: Session started at '%s' timestamp [%u].\n",
......
...@@ -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;
} }
......
...@@ -60,7 +60,7 @@ void nxagentInitOptions(void) ...@@ -60,7 +60,7 @@ void nxagentInitOptions(void)
nxagentOptions.LinkType = UNDEFINED; nxagentOptions.LinkType = UNDEFINED;
nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Desktop = UNDEFINED;
nxagentOptions.Persistent = 1; nxagentOptions.Persistent = True;
nxagentOptions.Rootless = UNDEFINED; nxagentOptions.Rootless = UNDEFINED;
nxagentOptions.Fullscreen = False; nxagentOptions.Fullscreen = False;
nxagentOptions.AllScreens = False; nxagentOptions.AllScreens = False;
...@@ -82,23 +82,23 @@ void nxagentInitOptions(void) ...@@ -82,23 +82,23 @@ void nxagentInitOptions(void)
nxagentOptions.Timeout = 0; nxagentOptions.Timeout = 0;
nxagentOptions.Nested = 0; nxagentOptions.Nested = False;
nxagentOptions.BackingStore = BackingStoreUndefined; nxagentOptions.BackingStore = BackingStoreUndefined;
nxagentOptions.Clipboard = ClipboardBoth; nxagentOptions.Clipboard = ClipboardBoth;
nxagentOptions.SharedMemory = 1; nxagentOptions.SharedMemory = True;
nxagentOptions.SharedPixmaps = 1; nxagentOptions.SharedPixmaps = True;
nxagentOptions.DeviceControl = 0; nxagentOptions.DeviceControl = False;
nxagentOptions.DeviceControlUserDefined = 0; nxagentOptions.DeviceControlUserDefined = False;
nxagentOptions.ResetKeyboardAtResume = 1; nxagentOptions.ResetKeyboardAtResume = True;
nxagentOptions.Reset = 0; nxagentOptions.Reset = False;
nxagentOptions.RootX = 0; nxagentOptions.RootX = 0;
nxagentOptions.RootY = 0; nxagentOptions.RootY = 0;
...@@ -118,25 +118,25 @@ void nxagentInitOptions(void) ...@@ -118,25 +118,25 @@ void nxagentInitOptions(void)
nxagentOptions.FloatXRatio = 1.0; nxagentOptions.FloatXRatio = 1.0;
nxagentOptions.FloatYRatio = 1.0; nxagentOptions.FloatYRatio = 1.0;
nxagentOptions.UseDamage = 1; nxagentOptions.UseDamage = True;
nxagentOptions.Binder = UNDEFINED; nxagentOptions.Binder = UNDEFINED;
nxagentOptions.BinderOptions = NULL; nxagentOptions.BinderOptions = NULL;
nxagentOptions.Xdmcp = 0; nxagentOptions.Xdmcp = False;
nxagentOptions.DisplayBuffer = UNDEFINED; nxagentOptions.DisplayBuffer = UNDEFINED;
nxagentOptions.DisplayCoalescence = 0; nxagentOptions.DisplayCoalescence = 0;
nxagentOptions.Composite = 1; nxagentOptions.Composite = True;
nxagentOptions.IgnoreVisibility = 0; nxagentOptions.IgnoreVisibility = False;
nxagentOptions.ViewOnly = 0; nxagentOptions.ViewOnly = False;
nxagentOptions.Adaptive = 0; nxagentOptions.Adaptive = False;
nxagentOptions.Streaming = 0; nxagentOptions.Streaming = False;
nxagentOptions.DeferLevel = UNDEFINED; nxagentOptions.DeferLevel = UNDEFINED;
nxagentOptions.DeferTimeout = 200; nxagentOptions.DeferTimeout = 200;
...@@ -144,19 +144,19 @@ void nxagentInitOptions(void) ...@@ -144,19 +144,19 @@ void nxagentInitOptions(void)
nxagentOptions.TileWidth = UNDEFINED; nxagentOptions.TileWidth = UNDEFINED;
nxagentOptions.TileHeight = UNDEFINED; nxagentOptions.TileHeight = UNDEFINED;
nxagentOptions.Menu = 1; nxagentOptions.Menu = True;
nxagentOptions.MagicPixel = 1; nxagentOptions.MagicPixel = True;
nxagentOptions.ClientOs = UNDEFINED; nxagentOptions.ClientOs = UNDEFINED;
nxagentOptions.InhibitXkb = 1; nxagentOptions.InhibitXkb = True;
nxagentOptions.CopyBufferSize = COPY_UNLIMITED; nxagentOptions.CopyBufferSize = COPY_UNLIMITED;
nxagentOptions.ImageRateLimit = 0; nxagentOptions.ImageRateLimit = 0;
nxagentOptions.Xinerama = 1; nxagentOptions.Xinerama = True;
nxagentOptions.SleepTimeMillis = DEFAULT_SLEEP_TIME_MILLIS; nxagentOptions.SleepTimeMillis = DEFAULT_SLEEP_TIME_MILLIS;
......
...@@ -84,7 +84,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) ...@@ -84,7 +84,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
* leaves the agent's window. * leaves the agent's window.
*/ */
if (nxagentOption(DeviceControl) == True) if (nxagentOption(DeviceControl))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "%s: WARNING! Propagating changes to pointer settings.\n", __func__); fprintf(stderr, "%s: WARNING! Propagating changes to pointer settings.\n", __func__);
......
...@@ -240,7 +240,7 @@ TODO: This should be reset only when the state became SESSION_DOWN. ...@@ -240,7 +240,7 @@ TODO: This should be reset only when the state became SESSION_DOWN.
*/ */
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)
{ {
...@@ -588,7 +588,7 @@ Bool nxagentReconnectSession(void) ...@@ -588,7 +588,7 @@ Bool nxagentReconnectSession(void)
} }
/* Reset the keyboard only if we detect any changes. */ /* Reset the keyboard only if we detect any changes. */
if (nxagentOption(ResetKeyboardAtResume) == 1) if (nxagentOption(ResetKeyboardAtResume))
{ {
if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
...@@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void) ...@@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void)
nxagentRedirectDefaultWindows(); nxagentRedirectDefaultWindows();
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama))
{ {
nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True); nxagentOption(RootHeight), True);
......
...@@ -2001,7 +2001,7 @@ N/A ...@@ -2001,7 +2001,7 @@ N/A
* change the real X server's keyboard and pointer settings. * change the real X server's keyboard 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");
} }
...@@ -2532,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2532,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
NXShadowSetDisplayUid(nxagentShadowUid); NXShadowSetDisplayUid(nxagentShadowUid);
} }
if (nxagentOption(UseDamage) == 0) if (nxagentOption(UseDamage))
{ {
NXShadowDisableDamage(); NXShadowDisableDamage();
} }
......
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