Unverified Commit faae65fb authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/rework_booleans_v2' into 3.6.x

parents d545afdf b44ecc0f
...@@ -116,7 +116,7 @@ is" without express or implied warranty. ...@@ -116,7 +116,7 @@ is" without express or implied warranty.
#undef DISABLE_SMART_SCHEDULE #undef DISABLE_SMART_SCHEDULE
int nxagentUserDefinedFontPath = 0; Bool nxagentUserDefinedFontPath = False;
/* /*
* From X11/ImUtil.c. * From X11/ImUtil.c.
...@@ -178,7 +178,7 @@ static void nxagentParseOptionString(char*); ...@@ -178,7 +178,7 @@ static void nxagentParseOptionString(char*);
static int nxagentGetDialogName(void); static int nxagentGetDialogName(void);
char nxagentVerbose = 0; Bool nxagentVerbose = False;
char *nxagentKeystrokeFile = NULL; char *nxagentKeystrokeFile = NULL;
...@@ -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;
} }
...@@ -507,7 +507,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -507,7 +507,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
sscanf(argv[i], "%i", &level) == 1 && sscanf(argv[i], "%i", &level) == 1 &&
level >= 0 && level <= 2) level >= 0 && level <= 2)
{ {
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeOption(DeferLevel, level); nxagentChangeOption(DeferLevel, level);
...@@ -558,7 +558,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -558,7 +558,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
fprintf(stderr, "ddxProcessArgument: User defined font path [%s].\n", argv[i]); fprintf(stderr, "ddxProcessArgument: User defined font path [%s].\n", argv[i]);
#endif #endif
nxagentUserDefinedFontPath = 1; nxagentUserDefinedFontPath = True;
defaultFontPath = argv[i]; defaultFontPath = argv[i];
} }
else else
...@@ -589,7 +589,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -589,7 +589,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
} }
} }
if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen) == 1)) if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen)))
{ {
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;
} }
...@@ -801,14 +801,9 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -801,14 +801,9 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-R")) if (!strcmp(argv[i], "-R"))
{ {
if (nxagentOption(Binder) == UNDEFINED ||
nxagentOption(Desktop) == UNDEFINED ||
nxagentOption(Rootless) == UNDEFINED)
{
nxagentChangeOption(Binder, False); nxagentChangeOption(Binder, False);
nxagentChangeOption(Desktop, False); nxagentChangeOption(Desktop, False);
nxagentChangeOption(Rootless, True); nxagentChangeOption(Rootless, True);
}
return 1; return 1;
} }
...@@ -830,9 +825,9 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -830,9 +825,9 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-S")) if (!strcmp(argv[i], "-S"))
{ {
nxagentChangeOption(Shadow, 1); nxagentChangeOption(Shadow, True);
nxagentChangeOption(DeferLevel, 0); nxagentChangeOption(DeferLevel, 0);
nxagentChangeOption(Persistent, 0); nxagentChangeOption(Persistent, False);
return 1; return 1;
} }
...@@ -858,11 +853,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -858,11 +853,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;
} }
...@@ -969,7 +964,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -969,7 +964,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-verbose")) if (!strcmp(argv[i], "-verbose"))
{ {
nxagentVerbose = 1; nxagentVerbose = True;
return 1; return 1;
} }
...@@ -998,7 +993,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -998,7 +993,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;
} }
...@@ -1080,7 +1075,7 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1080,7 +1075,7 @@ static void nxagentParseSingleOption(char *name, char *value)
} }
else if (!strcmp(name, "render")) else if (!strcmp(name, "render"))
{ {
if (nxagentReconnectTrap == True) if (nxagentReconnectTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n"); fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n");
...@@ -1111,7 +1106,7 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1111,7 +1106,7 @@ static void nxagentParseSingleOption(char *name, char *value)
} }
else if (!strcmp(name, "fullscreen")) else if (!strcmp(name, "fullscreen"))
{ {
if (nxagentReconnectTrap == True) if (nxagentReconnectTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n"); fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n");
...@@ -1174,11 +1169,11 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1174,11 +1169,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 +1185,25 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1190,25 +1185,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
{ {
...@@ -1220,13 +1215,13 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1220,13 +1215,13 @@ static void nxagentParseSingleOption(char *name, char *value)
} }
else if (!strcmp(name, "resize")) else if (!strcmp(name, "resize"))
{ {
if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0) if (!nxagentOption(DesktopResize) || strcmp(value, "0") == 0)
{ {
nxagentResizeDesktopAtStartup = 0; nxagentResizeDesktopAtStartup = False;
} }
else if (strcmp(value, "1") == 0) else if (strcmp(value, "1") == 0)
{ {
nxagentResizeDesktopAtStartup = 1; nxagentResizeDesktopAtStartup = True;
} }
else else
{ {
...@@ -1251,11 +1246,11 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1251,11 +1246,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,17 +1258,17 @@ static void nxagentParseSingleOption(char *name, char *value) ...@@ -1263,17 +1258,17 @@ 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;
} }
else if (!strcmp(name, "autodpi")) else if (!strcmp(name, "autodpi"))
{ {
if (nxagentReconnectTrap == True) if (nxagentReconnectTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n"); fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n");
...@@ -1749,13 +1744,14 @@ N/A ...@@ -1749,13 +1744,14 @@ N/A
#endif #endif
if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1) if (nxagentOption(Rootless) && nxagentOption(Fullscreen))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n");
#endif #endif
nxagentChangeOption(Fullscreen, False); nxagentChangeOption(Fullscreen, False);
nxagentChangeOption(AllScreens, False);
} }
/* /*
...@@ -1971,35 +1967,6 @@ N/A ...@@ -1971,35 +1967,6 @@ N/A
nxagentSetCoalescence(); nxagentSetCoalescence();
/* /*
* Set the other defaults.
*/
if (nxagentOption(Fullscreen) == UNDEFINED)
{
nxagentChangeOption(Fullscreen, False);
}
if (nxagentOption(AllScreens) == UNDEFINED)
{
nxagentChangeOption(AllScreens, False);
}
if (nxagentOption(Binder) == UNDEFINED)
{
nxagentChangeOption(Binder, False);
}
if (nxagentOption(Rootless) == UNDEFINED)
{
nxagentChangeOption(Rootless, False);
}
if (nxagentOption(Desktop) == UNDEFINED)
{
nxagentChangeOption(Desktop, True);
}
/*
* The enableBackingStore flag is defined * The enableBackingStore flag is defined
* in window.c in the dix. * in window.c in the dix.
*/ */
...@@ -2039,7 +2006,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2039,7 +2006,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
nxagentAlphaEnabled = False; nxagentAlphaEnabled = False;
} }
if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp)) if (nxagentOption(Rootless) && nxagentOption(Xdmcp))
{ {
FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n");
} }
...@@ -2048,7 +2015,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2048,7 +2015,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");
...@@ -2064,7 +2031,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2064,7 +2031,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");
...@@ -2176,7 +2143,7 @@ void nxagentSetPackMethod(void) ...@@ -2176,7 +2143,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;
...@@ -2199,7 +2166,7 @@ void nxagentSetPackMethod(void) ...@@ -2199,7 +2166,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
{ {
...@@ -2207,7 +2174,7 @@ void nxagentSetPackMethod(void) ...@@ -2207,7 +2174,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)
...@@ -2336,11 +2303,11 @@ void nxagentSetDeferLevel(void) ...@@ -2336,11 +2303,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))
...@@ -2363,7 +2330,7 @@ void nxagentSetDeferLevel(void) ...@@ -2363,7 +2330,7 @@ void nxagentSetDeferLevel(void)
* Set the defer timeout. * Set the defer timeout.
*/ */
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n"); fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n");
...@@ -2378,7 +2345,7 @@ void nxagentSetDeferLevel(void) ...@@ -2378,7 +2345,7 @@ void nxagentSetDeferLevel(void)
* Set the defer level. * Set the defer level.
*/ */
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n"); fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n");
...@@ -2482,7 +2449,7 @@ void nxagentSetScheduler(void) ...@@ -2482,7 +2449,7 @@ void nxagentSetScheduler(void)
* The smart scheduler is the default. * The smart scheduler is the default.
*/ */
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n"); fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n");
......
...@@ -97,7 +97,7 @@ void nxagentSetCoalescence(void); ...@@ -97,7 +97,7 @@ void nxagentSetCoalescence(void);
void nxagentShowVersionInfo(void); void nxagentShowVersionInfo(void);
extern int nxagentUserDefinedFontPath; extern Bool nxagentUserDefinedFontPath;
extern int nxagentRemoteMajor; extern int nxagentRemoteMajor;
......
...@@ -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);
} }
} }
} }
...@@ -457,7 +457,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client) ...@@ -457,7 +457,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
{ {
#ifdef TEST #ifdef TEST
if (nxagentNeedWakeupBySplit(client) == 0) if (!nxagentNeedWakeupBySplit(client))
{ {
fprintf(stderr, "++++++nxagentWaitWakeupBySplit: WARNING! The client [%d] is already awake.\n", fprintf(stderr, "++++++nxagentWaitWakeupBySplit: WARNING! The client [%d] is already awake.\n",
client -> index); client -> index);
...@@ -497,12 +497,12 @@ void nxagentWaitWakeupBySplit(ClientPtr client) ...@@ -497,12 +497,12 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
#endif #endif
if (nxagentNeedWakeupBySplit(client) == 0 || if (!nxagentNeedWakeupBySplit(client) ||
NXDisplayError(nxagentDisplay) == 1) NXDisplayError(nxagentDisplay) == 1)
{ {
#ifdef TEST #ifdef TEST
if (nxagentNeedWakeupBySplit(client) == 0) if (!nxagentNeedWakeupBySplit(client))
{ {
fprintf(stderr, "++++++nxagentWaitWakeupBySplit: Client [%d] can now run.\n", fprintf(stderr, "++++++nxagentWaitWakeupBySplit: Client [%d] can now run.\n",
client -> index); client -> index);
...@@ -535,7 +535,7 @@ FIXME: Should record a serial number for the client, so that the ...@@ -535,7 +535,7 @@ FIXME: Should record a serial number for the client, so that the
*/ */
if (client -> index < MAX_CONNECTIONS) if (client -> index < MAX_CONNECTIONS)
{ {
if (nxagentNeedWakeup(client) == 0) if (!nxagentNeedWakeup(client))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "++++++nxagentSuspendBySplit: Suspending client [%d] with agent sequence [%ld].\n", fprintf(stderr, "++++++nxagentSuspendBySplit: Suspending client [%d] with agent sequence [%ld].\n",
...@@ -583,7 +583,7 @@ FIXME: Should record a serial number for the client, so that the ...@@ -583,7 +583,7 @@ FIXME: Should record a serial number for the client, so that the
{ {
nxagentClientPriv(client) -> clientState &= ~SleepingBySplit; nxagentClientPriv(client) -> clientState &= ~SleepingBySplit;
if (nxagentNeedWakeup(client) == 0) if (!nxagentNeedWakeup(client))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "++++++nxagentWakeupBySplit: Resuming client [%d] with agent sequence [%ld].\n", fprintf(stderr, "++++++nxagentWakeupBySplit: Resuming client [%d] with agent sequence [%ld].\n",
...@@ -629,7 +629,7 @@ void nxagentCheckRestartedClients(struct timeval **timeout) ...@@ -629,7 +629,7 @@ void nxagentCheckRestartedClients(struct timeval **timeout)
for (int i = 1; i < currentMaxClients; i++) for (int i = 1; i < currentMaxClients; i++)
{ {
if (clients[i] != NULL && clients[i] -> osPrivate != NULL && if (clients[i] != NULL && clients[i] -> osPrivate != NULL &&
nxagentNeedWakeup(clients[i]) == 0) !nxagentNeedWakeup(clients[i]))
{ {
int fd = ((OsCommPtr) clients[i] -> osPrivate) -> fd; int fd = ((OsCommPtr) clients[i] -> osPrivate) -> fd;
......
...@@ -225,7 +225,7 @@ const char * getXErrorString(int code) ...@@ -225,7 +225,7 @@ const char * getXErrorString(int code)
* Save the values queried from X server. * Save the values queried from X server.
*/ */
XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 }; XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False };
extern Display *nxagentDisplay; extern Display *nxagentDisplay;
...@@ -1571,7 +1571,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, ...@@ -1571,7 +1571,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
* way to identify that situation during callback processing we * way to identify that situation during callback processing we
* could get rid of the Trap... * could get rid of the Trap...
*/ */
if (nxagentExternalClipboardEventTrap != 0) if (nxagentExternalClipboardEventTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__); fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__);
...@@ -2234,7 +2234,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) ...@@ -2234,7 +2234,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
XFixesSelectionClientCloseNotifyMask); XFixesSelectionClientCloseNotifyMask);
} }
nxagentXFixesInfo.Initialized = 1; nxagentXFixesInfo.Initialized = True;
} }
/* /*
......
...@@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo ...@@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo
int Opcode; int Opcode;
int EventBase; int EventBase;
int ErrorBase; int ErrorBase;
int Initialized; Bool Initialized;
} XFixesAgentInfoRec; } XFixesAgentInfoRec;
extern XFixesAgentInfoRec nxagentXFixesInfo; extern XFixesAgentInfoRec nxagentXFixesInfo;
......
...@@ -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;
...@@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void) ...@@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void)
void nxagentRedirectDefaultWindows(void) void nxagentRedirectDefaultWindows(void)
{ {
if (nxagentOption(Rootless) == 1 || if (nxagentOption(Rootless) ||
nxagentCompositeEnable == 0) nxagentCompositeEnable == 0)
{ {
#ifdef TEST #ifdef TEST
...@@ -154,7 +154,7 @@ void nxagentRedirectDefaultWindows(void) ...@@ -154,7 +154,7 @@ void nxagentRedirectDefaultWindows(void)
void nxagentRedirectWindow(WindowPtr pWin) void nxagentRedirectWindow(WindowPtr pWin)
{ {
if (nxagentOption(Rootless) == 0 || if (!nxagentOption(Rootless) ||
nxagentCompositeEnable == 0) nxagentCompositeEnable == 0)
{ {
#ifdef TEST #ifdef TEST
......
...@@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
Cursor cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None; Cursor cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None;
if (nxagentOption(Rootless) == False) if (!nxagentOption(Rootless))
{ {
XDefineCursor(nxagentDisplay, XDefineCursor(nxagentDisplay,
nxagentInputWindows[pScreen -> myNum], nxagentInputWindows[pScreen -> myNum],
......
...@@ -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");
...@@ -660,7 +660,7 @@ static void nxagentDisplayBlockHandler(Display *disp, int reason) ...@@ -660,7 +660,7 @@ static void nxagentDisplayBlockHandler(Display *disp, int reason)
fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Display is blocking for [write].\n"); fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Display is blocking for [write].\n");
#endif #endif
nxagentBlocking = 1; nxagentBlocking = True;
if (!SmartScheduleSignalEnable) if (!SmartScheduleSignalEnable)
{ {
...@@ -908,7 +908,7 @@ void nxagentResetDisplayHandlers(void) ...@@ -908,7 +908,7 @@ void nxagentResetDisplayHandlers(void)
*/ */
nxagentBuffer = 0; nxagentBuffer = 0;
nxagentBlocking = 0; nxagentBlocking = False;
nxagentCongestion = 0; nxagentCongestion = 0;
/* /*
...@@ -1796,7 +1796,7 @@ void nxagentCloseDisplay(void) ...@@ -1796,7 +1796,7 @@ void nxagentCloseDisplay(void)
nxagentDoFullGeneration, (void *) nxagentDisplay); nxagentDoFullGeneration, (void *) nxagentDisplay);
#endif #endif
if (nxagentDoFullGeneration == 0 || if (!nxagentDoFullGeneration ||
nxagentDisplay == NULL) nxagentDisplay == NULL)
{ {
return; return;
...@@ -2517,7 +2517,7 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2517,7 +2517,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT,
"Couldn't open the display."); "Couldn't open the display.");
return FALSE; return False;
} }
nxagentAddXConnection(); nxagentAddXConnection();
...@@ -2535,12 +2535,12 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2535,12 +2535,12 @@ Bool nxagentReconnectDisplay(void *p0)
#endif #endif
if (nxagentCheckForDefaultDepthCompatibility() == 0) if (!nxagentCheckForDefaultDepthCompatibility())
{ {
nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT,
"Default display depth doesn't match."); "Default display depth doesn't match.");
return FALSE; return False;
} }
nxagentUseNXTrans = nxagentPostProcessArgs(nxagentDisplayName, nxagentDisplay, nxagentUseNXTrans = nxagentPostProcessArgs(nxagentDisplayName, nxagentDisplay,
...@@ -2557,12 +2557,12 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2557,12 +2557,12 @@ Bool nxagentReconnectDisplay(void *p0)
* Init and compare the visuals. * Init and compare the visuals.
*/ */
if (nxagentInitAndCheckVisuals(flexibility) == FALSE) if (!nxagentInitAndCheckVisuals(flexibility))
{ {
nxagentSetReconnectError(FAILED_RESUME_VISUALS_ALERT, nxagentSetReconnectError(FAILED_RESUME_VISUALS_ALERT,
"Couldn't restore the required visuals."); "Couldn't restore the required visuals.");
return FALSE; return False;
} }
reconnectDisplayState = GOT_VISUAL_INFO; reconnectDisplayState = GOT_VISUAL_INFO;
...@@ -2612,7 +2612,7 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2612,7 +2612,7 @@ Bool nxagentReconnectDisplay(void *p0)
reconnectDisplayState = GOT_DEPTH_LIST; reconnectDisplayState = GOT_DEPTH_LIST;
if (nxagentCheckForDepthsCompatibility() == 0) if (!nxagentCheckForDepthsCompatibility())
{ {
nxagentSetReconnectError(FAILED_RESUME_DEPTHS_ALERT, nxagentSetReconnectError(FAILED_RESUME_DEPTHS_ALERT,
"Couldn't restore all the required depths."); "Couldn't restore all the required depths.");
...@@ -2634,7 +2634,7 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2634,7 +2634,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentInitPixmapFormats(); nxagentInitPixmapFormats();
if (nxagentCheckForPixmapFormatsCompatibility() == 0) if (!nxagentCheckForPixmapFormatsCompatibility())
{ {
nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT, nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT,
"Couldn't restore all the required pixmap formats."); "Couldn't restore all the required pixmap formats.");
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
/* /*
* The rectangles composing a region are de- fragmented to reduce the * The rectangles composing a region are de- fragmented to reduce the
* number of synch- ronizing PutImage's. * number of synchronizing PutImage()s.
*/ */
#define ADVANCED_BOXES_DEFRAG #define ADVANCED_BOXES_DEFRAG
...@@ -99,7 +99,7 @@ int nxagentCorruptedPixmaps = 0; ...@@ -99,7 +99,7 @@ int nxagentCorruptedPixmaps = 0;
int nxagentCorruptedWindows = 0; int nxagentCorruptedWindows = 0;
int nxagentCorruptedBackgrounds = 0; int nxagentCorruptedBackgrounds = 0;
int nxagentForceSynchronization = 0; Bool nxagentForceSynchronization = False;
_nxagentSynchronizationRec nxagentSynchronization = { (DrawablePtr) NULL, 0, 0, 0, 0, 0 }; _nxagentSynchronizationRec nxagentSynchronization = { (DrawablePtr) NULL, 0, 0, 0, 0, 0 };
...@@ -123,7 +123,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel); ...@@ -123,7 +123,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel);
unsigned long nxagentGetDrawableColor(DrawablePtr pDrawable); unsigned long nxagentGetDrawableColor(DrawablePtr pDrawable);
unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion); unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion);
int nxagentSkipImage = 0; Bool nxagentSkipImage = False;
static int nxagentTooManyImageData(void) static int nxagentTooManyImageData(void)
{ {
...@@ -144,7 +144,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre ...@@ -144,7 +144,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre
{ {
pDrawable = nxagentSplitDrawable(pDrawable); pDrawable = nxagentSplitDrawable(pDrawable);
if (nxagentLosslessTrap == 0) if (!nxagentLosslessTrap)
{ {
if (nxagentDrawableStatus(pDrawable) == Synchronized) if (nxagentDrawableStatus(pDrawable) == Synchronized)
{ {
...@@ -257,7 +257,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask ...@@ -257,7 +257,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
* copy with lossless compression turned off. * copy with lossless compression turned off.
*/ */
if (nxagentLosslessTrap == 1) if (nxagentLosslessTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "%s: Forcing synchronization of pixmap at [%p] with lossless compression.\n", fprintf(stderr, "%s: Forcing synchronization of pixmap at [%p] with lossless compression.\n",
...@@ -266,7 +266,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask ...@@ -266,7 +266,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
return reallySynchronizeDrawableData(pDrawable); return reallySynchronizeDrawableData(pDrawable);
} }
else if (nxagentReconnectTrap == 1) else if (nxagentReconnectTrap)
{ {
/* /*
* The pixmap data is not synchronized unless we need it. We * The pixmap data is not synchronized unless we need it. We
...@@ -277,7 +277,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask ...@@ -277,7 +277,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
if (pDrawable -> depth == 1) if (pDrawable -> depth == 1)
{ {
#ifdef TEST #ifdef TEST
if (nxagentReconnectTrap == 1) if (nxagentReconnectTrap)
{ {
static int totalLength; static int totalLength;
static int totalReconnectedPixmaps; static int totalReconnectedPixmaps;
...@@ -357,9 +357,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -357,9 +357,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
* full drawable. * full drawable.
*/ */
int useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion); Bool useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion);
if (useStoredBitmap != 0) if (useStoredBitmap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] " fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] "
...@@ -396,7 +396,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -396,7 +396,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
* The bitmap to synchronize is clipped. * The bitmap to synchronize is clipped.
*/ */
if (RegionNil(clipRegion) == 1) if (RegionNil(clipRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: The bitmap region [%d,%d,%d,%d] is not viewable. " fprintf(stderr, "nxagentSynchronizeRegion: The bitmap region [%d,%d,%d,%d] is not viewable. "
...@@ -418,7 +418,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -418,7 +418,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
} }
else else
{ {
if (pRegion != NullRegion && RegionNil(pRegion) == 1) if (pRegion != NullRegion && RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: Region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", fprintf(stderr, "nxagentSynchronizeRegion: Region [%d,%d,%d,%d] is nil. Skipping synchronization.\n",
...@@ -451,7 +451,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -451,7 +451,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable)); RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable));
if (RegionNil(clipRegion) == 1) if (RegionNil(clipRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: The corrupted region [%d,%d,%d,%d] is not viewable " fprintf(stderr, "nxagentSynchronizeRegion: The corrupted region [%d,%d,%d,%d] is not viewable "
...@@ -473,7 +473,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -473,7 +473,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
{ {
RegionIntersect(clipRegion, clipRegion, pRegion); RegionIntersect(clipRegion, clipRegion, pRegion);
if (RegionNil(clipRegion) == 1) if (RegionNil(clipRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: Region requested [%d,%d,%d,%d] already " fprintf(stderr, "nxagentSynchronizeRegion: Region requested [%d,%d,%d,%d] already "
...@@ -588,7 +588,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -588,7 +588,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
unsigned long now = GetTimeInMillis(); unsigned long now = GetTimeInMillis();
nxagentSynchronization.abort = 0; nxagentSynchronization.abort = False;
/* /*
* Going to split the updated region into small blocks. * Going to split the updated region into small blocks.
...@@ -652,7 +652,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -652,7 +652,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
"[%lu] ms elapsed.\n", elapsedTime); "[%lu] ms elapsed.\n", elapsedTime);
#endif #endif
nxagentSynchronization.abort = 1; nxagentSynchronization.abort = True;
goto nxagentSynchronizeRegionStop; goto nxagentSynchronizeRegionStop;
} }
...@@ -670,7 +670,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -670,7 +670,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentBlocking); nxagentBlocking);
#endif #endif
nxagentSynchronization.abort = 1; nxagentSynchronization.abort = True;
goto nxagentSynchronizeRegionStop; goto nxagentSynchronizeRegionStop;
} }
...@@ -687,7 +687,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -687,7 +687,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentCongestion); nxagentCongestion);
#endif #endif
nxagentSynchronization.abort = 1; nxagentSynchronization.abort = True;
goto nxagentSynchronizeRegionStop; goto nxagentSynchronizeRegionStop;
} }
...@@ -799,7 +799,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -799,7 +799,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (owner != NULL) if (owner != NULL)
{ {
if (nxagentOption(Shadow) == 1 && if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE || (nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE)) nxagentOption(YRatio) != DONT_SCALE))
{ {
...@@ -834,7 +834,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned ...@@ -834,7 +834,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
"new input events.\n"); "new input events.\n");
#endif #endif
nxagentSynchronization.abort = 1; nxagentSynchronization.abort = True;
goto nxagentSynchronizeRegionStop; goto nxagentSynchronizeRegionStop;
} }
...@@ -852,9 +852,9 @@ nxagentSynchronizeRegionStop: ...@@ -852,9 +852,9 @@ nxagentSynchronizeRegionStop:
success = 1; success = 1;
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
if (nxagentSynchronization.abort == 1) if (nxagentSynchronization.abort)
{ {
/* /*
* Storing the pointer to the drawable we were synchronizing * Storing the pointer to the drawable we were synchronizing
...@@ -888,7 +888,7 @@ nxagentSynchronizeRegionStop: ...@@ -888,7 +888,7 @@ nxagentSynchronizeRegionStop:
if (pDrawable -> type == DRAWABLE_PIXMAP && if (pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentIsCorruptedBackground((PixmapPtr) pDrawable) == 1 && nxagentIsCorruptedBackground((PixmapPtr) pDrawable) == 1 &&
RegionNil(&exposeRegion) == 0) !RegionNil(&exposeRegion))
{ {
struct nxagentExposeBackground eb = { struct nxagentExposeBackground eb = {
.pBackground = (PixmapPtr) pDrawable, .pBackground = (PixmapPtr) pDrawable,
...@@ -921,7 +921,7 @@ nxagentSynchronizeRegionStop: ...@@ -921,7 +921,7 @@ nxagentSynchronizeRegionStop:
int w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; int w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1;
int h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; int h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1;
if (nxagentOption(Shadow) == 1 && if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE || (nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE)) nxagentOption(YRatio) != DONT_SCALE))
{ {
...@@ -994,7 +994,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea ...@@ -994,7 +994,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea
pBox -> x2 - pBox -> x1, pBox -> y2 - pBox -> y1); pBox -> x2 - pBox -> x1, pBox -> y2 - pBox -> y1);
if (RegionNil(pRegion) == 1) if (RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeBox: Resulting region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", fprintf(stderr, "nxagentSynchronizeBox: Resulting region [%d,%d,%d,%d] is nil. Skipping synchronization.\n",
...@@ -1023,7 +1023,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) ...@@ -1023,7 +1023,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2)
DrawablePtr pDrawable = (DrawablePtr) p0; DrawablePtr pDrawable = (DrawablePtr) p0;
unsigned int *breakMask = (unsigned int *) p2; unsigned int *breakMask = (unsigned int *) p2;
int shouldClearHiddenRegion = 1; Bool shouldClearHiddenRegion = True;
/* /*
* The nxagentSynchronization.abort propagates a break condition * The nxagentSynchronization.abort propagates a break condition
...@@ -1031,7 +1031,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) ...@@ -1031,7 +1031,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2)
* synchronizations. * synchronizations.
*/ */
if (nxagentSynchronization.abort == 1 || if (nxagentSynchronization.abort ||
nxagentDrawableStatus(pDrawable) == Synchronized) nxagentDrawableStatus(pDrawable) == Synchronized)
{ {
return; return;
...@@ -1104,7 +1104,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) ...@@ -1104,7 +1104,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2)
(void *) pDrawable); (void *) pDrawable);
#endif #endif
if (shouldClearHiddenRegion == 1) if (shouldClearHiddenRegion)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the not visible window " fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the not visible window "
...@@ -1138,7 +1138,7 @@ FIXME: This condition sounds only as a complication, as the break ...@@ -1138,7 +1138,7 @@ FIXME: This condition sounds only as a complication, as the break
nxagentCongestion, nxagentBlocking); nxagentCongestion, nxagentBlocking);
#endif #endif
nxagentSynchronization.abort = 1; nxagentSynchronization.abort = True;
return; return;
} }
...@@ -1179,8 +1179,8 @@ FIXME: This condition sounds only as a complication, as the break ...@@ -1179,8 +1179,8 @@ FIXME: This condition sounds only as a complication, as the break
* clear it. * clear it.
*/ */
if (nxagentSynchronization.abort == 0 && if (!nxagentSynchronization.abort &&
shouldClearHiddenRegion == 1) shouldClearHiddenRegion)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the remaining corrupted " fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the remaining corrupted "
...@@ -1241,9 +1241,9 @@ FIXME: All drawables should be set as synchronized and never marked as ...@@ -1241,9 +1241,9 @@ FIXME: All drawables should be set as synchronized and never marked as
* round-robin and if the bitmaps are all synchronized. * round-robin and if the bitmaps are all synchronized.
*/ */
int doRoundRobin = (nxagentSynchronization.pDrawable != NULL); Bool doRoundRobin = (nxagentSynchronization.pDrawable != NULL);
nxagentSynchronization.abort = 0; nxagentSynchronization.abort = False;
/* /*
* Synchronize the windows. * Synchronize the windows.
...@@ -1260,9 +1260,9 @@ FIXME: All drawables should be set as synchronized and never marked as ...@@ -1260,9 +1260,9 @@ FIXME: All drawables should be set as synchronized and never marked as
#ifdef TEST #ifdef TEST
if (nxagentSynchronization.abort == 0 && if (!nxagentSynchronization.abort &&
nxagentSynchronization.windowBitmaps == 0 && nxagentSynchronization.windowBitmaps == 0 &&
doRoundRobin == 0) !doRoundRobin)
{ {
if (nxagentCorruptedWindows > 0) if (nxagentCorruptedWindows > 0)
{ {
...@@ -1280,7 +1280,7 @@ FIXME: All drawables should be set as synchronized and never marked as ...@@ -1280,7 +1280,7 @@ FIXME: All drawables should be set as synchronized and never marked as
* Synchronize the backgrounds. * Synchronize the backgrounds.
*/ */
if (nxagentSynchronization.abort == 0 && if (!nxagentSynchronization.abort &&
NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_BACKGROUNDS(mask)) NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_BACKGROUNDS(mask))
{ {
#ifdef TEST #ifdef TEST
...@@ -1292,9 +1292,9 @@ FIXME: All drawables should be set as synchronized and never marked as ...@@ -1292,9 +1292,9 @@ FIXME: All drawables should be set as synchronized and never marked as
#ifdef TEST #ifdef TEST
if (nxagentSynchronization.abort == 0 && if (!nxagentSynchronization.abort &&
nxagentSynchronization.backgroundBitmaps == 0 && nxagentSynchronization.backgroundBitmaps == 0 &&
doRoundRobin == 0) !doRoundRobin)
{ {
if (nxagentCorruptedBackgrounds > 0) if (nxagentCorruptedBackgrounds > 0)
{ {
...@@ -1315,7 +1315,7 @@ FIXME: All drawables should be set as synchronized and never marked as ...@@ -1315,7 +1315,7 @@ FIXME: All drawables should be set as synchronized and never marked as
* the pixmap in a copy or in a composite operation. * the pixmap in a copy or in a composite operation.
*/ */
if (nxagentSynchronization.abort == 0 && if (!nxagentSynchronization.abort &&
NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask)) NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask))
{ {
#ifdef TEST #ifdef TEST
...@@ -1326,9 +1326,9 @@ FIXME: All drawables should be set as synchronized and never marked as ...@@ -1326,9 +1326,9 @@ FIXME: All drawables should be set as synchronized and never marked as
nxagentSynchronizeDrawablePredicate, &breakMask); nxagentSynchronizeDrawablePredicate, &breakMask);
if (nxagentSynchronization.abort == 0 && if (!nxagentSynchronization.abort &&
nxagentSynchronization.pixmapBitmaps == 0 && nxagentSynchronization.pixmapBitmaps == 0 &&
doRoundRobin == 0) !doRoundRobin)
{ {
#ifdef TEST #ifdef TEST
...@@ -1441,7 +1441,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ...@@ -1441,7 +1441,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
* clipmask. * clipmask.
*/ */
if (RegionNil(pRegion) == 0 && if (!RegionNil(pRegion) &&
pGC != NULL && pGC -> clientClip != NULL && pGC != NULL && pGC -> clientClip != NULL &&
pGC -> clientClipType == CT_REGION) pGC -> clientClipType == CT_REGION)
{ {
...@@ -1478,7 +1478,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ...@@ -1478,7 +1478,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion)
{ {
if (pRegion != NullRegion && RegionNil(pRegion) == 1) if (pRegion != NullRegion && RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentMarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", fprintf(stderr, "nxagentMarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n",
...@@ -1552,7 +1552,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -1552,7 +1552,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion)
void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion)
{ {
if (pRegion != NullRegion && RegionNil(pRegion) == 1) if (pRegion != NullRegion && RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentUnmarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", fprintf(stderr, "nxagentUnmarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n",
...@@ -2001,7 +2001,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel) ...@@ -2001,7 +2001,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel)
unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion) unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion)
{ {
if (RegionNil(pRegion) == 1) if (RegionNil(pRegion))
{ {
return nxagentGetDrawableColor(pDrawable); return nxagentGetDrawableColor(pDrawable);
} }
...@@ -2055,7 +2055,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -2055,7 +2055,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion)
return; return;
} }
if (pRegion == NullRegion || RegionNil(pRegion) == 1) if (pRegion == NullRegion || RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentClearRegion: The region is empty. Exiting.\n"); fprintf(stderr, "nxagentClearRegion: The region is empty. Exiting.\n");
...@@ -2145,7 +2145,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -2145,7 +2145,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion)
void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion)
{ {
if (RegionNil(pRegion) == 1) if (RegionNil(pRegion))
{ {
return; return;
} }
...@@ -2309,7 +2309,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) ...@@ -2309,7 +2309,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2)
* The window is not visible. * The window is not visible.
*/ */
if (nxagentWindowIsVisible(pWin) == 0) if (!nxagentWindowIsVisible(pWin))
{ {
return; return;
} }
...@@ -2328,7 +2328,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) ...@@ -2328,7 +2328,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2)
nxagentFreeRegion(clipRegion); nxagentFreeRegion(clipRegion);
if (RegionNil(&visRegion) == 1) if (RegionNil(&visRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCorruptedRegionOnWindow: The corrupted region of window at [%p] is hidden.\n", fprintf(stderr, "nxagentCorruptedRegionOnWindow: The corrupted region of window at [%p] is hidden.\n",
...@@ -2455,7 +2455,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) ...@@ -2455,7 +2455,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
RegionIntersect(pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable)); RegionIntersect(pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable));
if (RegionNil(pClipRegion) == 1) if (RegionNil(pClipRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCreateDrawableBitmap: The corrupted region is not visible. Skipping bitmap creation.\n"); fprintf(stderr, "nxagentCreateDrawableBitmap: The corrupted region is not visible. Skipping bitmap creation.\n");
...@@ -2658,7 +2658,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type) ...@@ -2658,7 +2658,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type)
*/ */
if (nxagentPixmapUsageCounter((PixmapPtr) pDrawable) >= MINIMUM_PIXMAP_USAGE_COUNTER && if (nxagentPixmapUsageCounter((PixmapPtr) pDrawable) >= MINIMUM_PIXMAP_USAGE_COUNTER &&
nxagentIsShmPixmap((PixmapPtr) pDrawable) == 0) !nxagentIsShmPixmap((PixmapPtr) pDrawable))
{ {
pRealPixmap = nxagentRealPixmap((PixmapPtr) pDrawable); pRealPixmap = nxagentRealPixmap((PixmapPtr) pDrawable);
...@@ -2780,14 +2780,14 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt ...@@ -2780,14 +2780,14 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt
{ {
RegionRec clipRegion; RegionRec clipRegion;
if (pRegion != NullRegion && RegionNil(pRegion) == 0 && if (pRegion != NullRegion && !RegionNil(pRegion) &&
nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized) nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized)
{ {
RegionInit(&clipRegion, NullBox, 1); RegionInit(&clipRegion, NullBox, 1);
RegionCopy(&clipRegion, pRegion); RegionCopy(&clipRegion, pRegion);
if (pOther != NullRegion && RegionNil(pOther) == 0) if (pOther != NullRegion && !RegionNil(pOther))
{ {
RegionUnion(&clipRegion, &clipRegion, pOther); RegionUnion(&clipRegion, &clipRegion, pOther);
} }
...@@ -2815,7 +2815,7 @@ int nxagentSynchronizationPredicate(void) ...@@ -2815,7 +2815,7 @@ int nxagentSynchronizationPredicate(void)
return NotNeeded; return NotNeeded;
} }
if (nxagentBlocking == 0 && if (!nxagentBlocking &&
nxagentCongestion <= 4 && nxagentCongestion <= 4 &&
nxagentReady == 0 && nxagentReady == 0 &&
nxagentUserInput(NULL) == 0) nxagentUserInput(NULL) == 0)
...@@ -2871,7 +2871,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt ...@@ -2871,7 +2871,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt
RegionSubtract(&expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin)); RegionSubtract(&expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin));
if (RegionNil(&pWin -> clipList) != 0) if (RegionNil(&pWin -> clipList))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSendBackgroundExpose: Exposures deferred because the window " fprintf(stderr, "nxagentSendBackgroundExpose: Exposures deferred because the window "
...@@ -2897,7 +2897,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt ...@@ -2897,7 +2897,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt
pBackingStore = (miBSWindowPtr)pWin->backStorage; pBackingStore = (miBSWindowPtr)pWin->backStorage;
if ((pBackingStore != NULL) && (RegionNil(&pBackingStore->SavedRegion) == 0)) if ((pBackingStore != NULL) && !RegionNil(&pBackingStore->SavedRegion))
{ {
RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y); RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y);
...@@ -2931,7 +2931,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2) ...@@ -2931,7 +2931,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2)
struct nxagentExposeBackground *pPair = p2; struct nxagentExposeBackground *pPair = p2;
if (RegionNil(pPair -> pExpose) != 0) if (RegionNil(pPair -> pExpose))
{ {
return; return;
} }
......
...@@ -38,7 +38,7 @@ typedef struct ...@@ -38,7 +38,7 @@ typedef struct
{ {
DrawablePtr pDrawable; DrawablePtr pDrawable;
int drawableType; int drawableType;
int abort; Bool abort;
int windowBitmaps; int windowBitmaps;
int pixmapBitmaps; int pixmapBitmaps;
int backgroundBitmaps; int backgroundBitmaps;
...@@ -157,7 +157,7 @@ extern int nxagentCorruptedPixmaps; ...@@ -157,7 +157,7 @@ extern int nxagentCorruptedPixmaps;
extern int nxagentCorruptedWindows; extern int nxagentCorruptedWindows;
extern int nxagentCorruptedBackgrounds; extern int nxagentCorruptedBackgrounds;
extern int nxagentForceSynchronization; extern Bool nxagentForceSynchronization;
extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
int width, int height); int width, int height);
......
...@@ -106,7 +106,7 @@ static int nxagentPrintError(Display *dpy, XErrorEvent *event, FILE *fp); ...@@ -106,7 +106,7 @@ static int nxagentPrintError(Display *dpy, XErrorEvent *event, FILE *fp);
int nxagentErrorHandler(Display *dpy, XErrorEvent *event) int nxagentErrorHandler(Display *dpy, XErrorEvent *event)
{ {
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
nxagentPrintError(dpy, event, stderr); nxagentPrintError(dpy, event, stderr);
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
extern char *nxagentClientsLogName; extern char *nxagentClientsLogName;
extern char nxagentVerbose; extern Bool nxagentVerbose;
int nxagentErrorHandler(Display *dpy, XErrorEvent *event); int nxagentErrorHandler(Display *dpy, XErrorEvent *event);
......
...@@ -569,13 +569,13 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) ...@@ -569,13 +569,13 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentChangeOption(DesktopResize, !desktopResize); nxagentChangeOption(DesktopResize, !desktopResize);
if (nxagentOption(DesktopResize) == 0) if (!nxagentOption(DesktopResize))
{ {
fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n"); fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n");
nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE);
if (nxagentOption(Fullscreen) == 0) if (!nxagentOption(Fullscreen))
{ {
nxagentSetWMNormalHintsMaxsize(pScreen, nxagentSetWMNormalHintsMaxsize(pScreen,
nxagentOption(RootWidth), nxagentOption(RootWidth),
...@@ -607,7 +607,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) ...@@ -607,7 +607,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
nxagentChangeOption(DesktopResize, !desktopResize); nxagentChangeOption(DesktopResize, !desktopResize);
if (nxagentOption(DesktopResize) == 0) if (!nxagentOption(DesktopResize))
{ {
nxagentShadowSetRatio(1.0, 1.0); nxagentShadowSetRatio(1.0, 1.0);
...@@ -660,7 +660,7 @@ static void nxagentSwitchDeferMode(void) ...@@ -660,7 +660,7 @@ static void nxagentSwitchDeferMode(void)
{ {
nxagentLaunchDialog(DIALOG_DISABLE_DEFER_MODE); nxagentLaunchDialog(DIALOG_DISABLE_DEFER_MODE);
nxagentForceSynchronization = 1; nxagentForceSynchronization = True;
} }
} }
...@@ -1043,7 +1043,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) ...@@ -1043,7 +1043,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
} }
case doSwitchResizeMode: case doSwitchResizeMode:
{ {
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
if (nxagentNoDialogIsRunning) if (nxagentNoDialogIsRunning)
{ {
...@@ -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) && result == doNothing)
{ {
X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode);
...@@ -1143,7 +1143,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1143,7 +1143,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
nxagentKeyDown = 0; nxagentKeyDown = 0;
} }
if (nxagentXkbState.Initialized == 0) if (!nxagentXkbState.Initialized)
{ {
if (X.xkey.keycode == nxagentCapsLockKeycode) if (X.xkey.keycode == nxagentCapsLockKeycode)
{ {
...@@ -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);
...@@ -1229,7 +1229,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1229,7 +1229,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
} }
} }
if (nxagentOption(DesktopResize) == False && if (!nxagentOption(DesktopResize) &&
(X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask)) (X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask))
{ {
/* /*
...@@ -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);
...@@ -1492,7 +1492,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1492,7 +1492,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
NXShadowEvent(nxagentDisplay, X); NXShadowEvent(nxagentDisplay, X);
} }
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentInputEvent = 1; nxagentInputEvent = 1;
} }
...@@ -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;
...@@ -1724,7 +1724,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1724,7 +1724,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
nxagentScreenTrap = False; nxagentScreenTrap = False;
} }
if (nxagentOption(Fullscreen) == 1 && if (nxagentOption(Fullscreen) &&
X.xcrossing.window == nxagentFullscreenWindow && X.xcrossing.window == nxagentFullscreenWindow &&
X.xcrossing.detail != NotifyInferior) X.xcrossing.detail != NotifyInferior)
{ {
...@@ -1851,7 +1851,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1851,7 +1851,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
{ {
int value = X.xvisibility.state; int value = X.xvisibility.state;
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value); TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value);
} }
...@@ -1959,7 +1959,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -1959,7 +1959,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
if (nxagentExposeQueue.exposures[nxagentExposeQueue.start].serial != X.xconfigure.x) if (nxagentExposeQueue.exposures[nxagentExposeQueue.start].serial != X.xconfigure.x)
{ {
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "%s: Requested ConfigureNotify changes didn't take place.\n", __func__); fprintf(stderr, "%s: Requested ConfigureNotify changes didn't take place.\n", __func__);
} }
...@@ -2003,13 +2003,13 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2003,13 +2003,13 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
fprintf(stderr, "%s: Going to handle new UnmapNotify event.\n", __func__); fprintf(stderr, "%s: Going to handle new UnmapNotify event.\n", __func__);
#endif #endif
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
WindowPtr pWin; WindowPtr pWin;
if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL || if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL ||
((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL && ((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL &&
nxagentWindowTopLevel(pWin) == 1)) nxagentWindowTopLevel(pWin)))
{ {
nxagentScreenTrap = True; nxagentScreenTrap = True;
...@@ -2019,8 +2019,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2019,8 +2019,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
} }
} }
if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) &&
nxagentOption(Nested) == 0 && !nxagentOption(Nested) &&
X.xmap.window != nxagentIconWindow) X.xmap.window != nxagentIconWindow)
{ {
nxagentVisibility = VisibilityFullyObscured; nxagentVisibility = VisibilityFullyObscured;
...@@ -2034,13 +2034,13 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2034,13 +2034,13 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
fprintf(stderr, "%s: Going to handle new MapNotify event.\n", __func__); fprintf(stderr, "%s: Going to handle new MapNotify event.\n", __func__);
#endif #endif
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
WindowPtr pWin; WindowPtr pWin;
if ((pWin = nxagentRootlessTopLevelWindow(X.xmap.window)) != NULL || if ((pWin = nxagentRootlessTopLevelWindow(X.xmap.window)) != NULL ||
((pWin = nxagentWindowPtr(X.xmap.window)) != NULL && ((pWin = nxagentWindowPtr(X.xmap.window)) != NULL &&
nxagentWindowTopLevel(pWin) == 1)) nxagentWindowTopLevel(pWin)))
{ {
nxagentScreenTrap = True; nxagentScreenTrap = True;
...@@ -2057,7 +2057,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2057,7 +2057,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
} }
} }
if (nxagentOption(AllScreens) == 1) if (nxagentOption(AllScreens))
{ {
if (X.xmap.window == nxagentIconWindow) if (X.xmap.window == nxagentIconWindow)
{ {
...@@ -2066,7 +2066,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2066,7 +2066,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
} }
} }
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
nxagentVisibility = VisibilityUnobscured; nxagentVisibility = VisibilityUnobscured;
nxagentVisibilityStop = False; nxagentVisibilityStop = False;
...@@ -2185,7 +2185,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2185,7 +2185,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
if (switchFullscreen) if (switchFullscreen)
{ {
if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1) if (nxagentOption(AllScreens) && nxagentOption(Fullscreen))
{ {
nxagentSwitchAllScreens(pScreen, 0); nxagentSwitchAllScreens(pScreen, 0);
} }
...@@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
if (switchAllScreens) if (switchAllScreens)
{ {
if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1) if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen))
{ {
nxagentSwitchFullscreen(pScreen, False); nxagentSwitchFullscreen(pScreen, False);
} }
...@@ -2263,7 +2263,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already ...@@ -2263,7 +2263,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
{ {
if (nxagentXkbState.Initialized == 0) if (!nxagentXkbState.Initialized)
{ {
if (X -> xkey.keycode == nxagentCapsLockKeycode) if (X -> xkey.keycode == nxagentCapsLockKeycode)
{ {
...@@ -2741,7 +2741,7 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X) ...@@ -2741,7 +2741,7 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X)
nxagentXkbState.Locked); nxagentXkbState.Locked);
#endif #endif
nxagentXkbState.Initialized = 1; nxagentXkbState.Initialized = True;
if (nxagentXkbState.Caps == 0 && if (nxagentXkbState.Caps == 0 &&
(nxagentXkbState.Locked & CAPSFLAG_IN_EVENT)) (nxagentXkbState.Locked & CAPSFLAG_IN_EVENT))
...@@ -2831,7 +2831,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) ...@@ -2831,7 +2831,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
{ {
XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X; XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X;
if (nxagentXFixesInfo.Initialized == 0) if (!nxagentXFixesInfo.Initialized)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: XFixes not initialized - doing nothing.\n", __func__); fprintf(stderr, "%s: XFixes not initialized - doing nothing.\n", __func__);
...@@ -3152,7 +3152,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3152,7 +3152,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay)); fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay));
#endif #endif
if (nxagentOption(Rootless) == True) if (nxagentOption(Rootless))
{ {
int sendEventAnyway = 0; int sendEventAnyway = 0;
...@@ -3272,7 +3272,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3272,7 +3272,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
return 1; return 1;
} }
} }
else /* (nxagentOption(Rootless) == True) */ else /* (nxagentOption(Rootless)) */
{ {
/* /*
* Save the position of the agent default window. Don't save the * Save the position of the agent default window. Don't save the
...@@ -3291,7 +3291,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3291,7 +3291,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum]) if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum])
{ {
if (nxagentOption(AllScreens) == 0) if (!nxagentOption(AllScreens))
{ {
/* /*
* - WITHOUT window manager any position change is relevant * - WITHOUT window manager any position change is relevant
...@@ -3303,7 +3303,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3303,7 +3303,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
int newX = X -> xconfigure.x; int newX = X -> xconfigure.x;
int newY = X -> xconfigure.y; int newY = X -> xconfigure.y;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
if (nxagentOption(Width) != X -> xconfigure.width || if (nxagentOption(Width) != X -> xconfigure.width ||
nxagentOption(Height) != X -> xconfigure.height || nxagentOption(Height) != X -> xconfigure.height ||
...@@ -3369,11 +3369,11 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3369,11 +3369,11 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentChangeOption(Y, newY); nxagentChangeOption(Y, newY);
} }
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && if (nxagentOption(Shadow) && nxagentOption(DesktopResize) &&
(nxagentOption(Width) != X -> xconfigure.width || (nxagentOption(Width) != X -> xconfigure.width ||
nxagentOption(Height) != X -> xconfigure.height)) nxagentOption(Height) != X -> xconfigure.height))
{ {
nxagentShadowResize = 1; nxagentShadowResize = True;
} }
if (nxagentOption(Width) != X->xconfigure.width || nxagentOption(Height) != X->xconfigure.height) if (nxagentOption(Width) != X->xconfigure.width || nxagentOption(Height) != X->xconfigure.height)
...@@ -3397,7 +3397,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3397,7 +3397,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
/* if in shadowing mode or if neither size nor position have /* if in shadowing mode or if neither size nor position have
changed we do not need to adjust RandR */ changed we do not need to adjust RandR */
/* FIXME: Comment makes no sense */ /* FIXME: Comment makes no sense */
if (nxagentOption(Shadow) == 1 || if (nxagentOption(Shadow) ||
(nxagentOption(Width) == nxagentOption(RootWidth) && (nxagentOption(Width) == nxagentOption(RootWidth) &&
nxagentOption(Height) == nxagentOption(RootHeight) && nxagentOption(Height) == nxagentOption(RootHeight) &&
nxagentOption(X) == nxagentOption(RootX) && nxagentOption(X) == nxagentOption(RootX) &&
...@@ -3409,7 +3409,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3409,7 +3409,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0,
X -> xconfigure.width, X -> xconfigure.height); X -> xconfigure.width, X -> xconfigure.height);
if (nxagentOption(Fullscreen) == 0) if (!nxagentOption(Fullscreen))
{ {
/* FIXME: has already been done some lines above */ /* FIXME: has already been done some lines above */
nxagentMoveViewport(pScreen, 0, 0); nxagentMoveViewport(pScreen, 0, 0);
...@@ -3592,7 +3592,7 @@ int nxagentHandleReparentNotify(XEvent* X) ...@@ -3592,7 +3592,7 @@ int nxagentHandleReparentNotify(XEvent* X)
return 1; return 1;
} }
else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 && else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) &&
nxagentOption(WMBorderWidth) == -1) nxagentOption(WMBorderWidth) == -1)
{ {
/* /*
...@@ -4065,7 +4065,7 @@ void nxagentSynchronizeExpose(void) ...@@ -4065,7 +4065,7 @@ void nxagentSynchronizeExpose(void)
(nxagentExposeQueueHead.remoteRegion), (nxagentExposeQueueHead.remoteRegion),
(nxagentExposeQueueHead.localRegion)); (nxagentExposeQueueHead.localRegion));
if (RegionNil(nxagentExposeQueueHead.remoteRegion) == 0 && if (!RegionNil(nxagentExposeQueueHead.remoteRegion) &&
((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask)) ((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask))
{ {
#ifdef TEST #ifdef TEST
...@@ -4323,7 +4323,7 @@ int nxagentUserInput(void *p) ...@@ -4323,7 +4323,7 @@ int nxagentUserInput(void *p)
* eventually change the nxagentInputEvent status. * eventually change the nxagentInputEvent status.
*/ */
if (nxagentOption(Shadow) == 1 && if (nxagentOption(Shadow) &&
nxagentPendingEvents(nxagentDisplay) > 0) nxagentPendingEvents(nxagentDisplay) > 0)
{ {
nxagentDispatchEvents(NULL); nxagentDispatchEvents(NULL);
...@@ -4342,7 +4342,7 @@ int nxagentUserInput(void *p) ...@@ -4342,7 +4342,7 @@ int nxagentUserInput(void *p)
* browser's page), in order to update the screen smoothly. * browser's page), in order to update the screen smoothly.
*/ */
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
return result; return result;
} }
......
...@@ -209,7 +209,7 @@ extern int nxagentInputEvent; ...@@ -209,7 +209,7 @@ extern int nxagentInputEvent;
* Event-handling utilities. * Event-handling utilities.
*/ */
Bool nxagentPendingEvents(Display *dpy); int nxagentPendingEvents(Display *dpy);
#define nxagentQueuedEvents(display) \ #define nxagentQueuedEvents(display) \
XQLength((display)) XQLength((display))
......
...@@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
{ {
if (width == 0) if (width == 0)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
} }
...@@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
if (height == 0) if (height == 0)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
} }
...@@ -417,7 +417,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -417,7 +417,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width, XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width,
height); height);
...@@ -429,20 +429,20 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -429,20 +429,20 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
{ {
UpdateCurrentTime(); UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 && if (nxagentOption(DesktopResize) &&
(nxagentOption(Fullscreen) == 1 || (nxagentOption(Fullscreen) ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
{ {
if (nxagentOption(ClientOs) != ClientOsWinnt if (nxagentOption(ClientOs) != ClientOsWinnt
/*&& nxagentOption(ClientOs) != ClientNXPlayer*/) /*&& nxagentOption(ClientOs) != ClientNXPlayer*/)
{ {
nxagentChangeOption(DesktopResize, 0); nxagentChangeOption(DesktopResize, False);
} }
} }
if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) &&
nxagentOption(AllScreens) == 0) !nxagentOption(AllScreens))
{ {
nxagentChangeOption(Width, width); nxagentChangeOption(Width, width);
nxagentChangeOption(Height, height); nxagentChangeOption(Height, height);
...@@ -450,8 +450,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -450,8 +450,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True); int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True);
if (result == 1 && nxagentOption(DesktopResize) == 1 && if (result == 1 && nxagentOption(DesktopResize) &&
nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) !nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{ {
nxagentRandRSetWindowsSize(width, height); nxagentRandRSetWindowsSize(width, height);
nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height)); nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height));
......
...@@ -102,7 +102,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP ...@@ -102,7 +102,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont); static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont);
int nxagentFreeFont(XFontStruct *fs); int nxagentFreeFont(XFontStruct *fs);
static Bool nxagentGetFontServerPath(char * fontServerPath, int size); static Bool nxagentGetFontServerPath(char * fontServerPath, int size);
static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution); static char * nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution);
RESTYPE RT_NX_FONT; RESTYPE RT_NX_FONT;
...@@ -414,10 +414,10 @@ Bool nxagentFontLookUp(const char *name) ...@@ -414,10 +414,10 @@ Bool nxagentFontLookUp(const char *name)
if (name && strlen(name) == 0) if (name && strlen(name) == 0)
{ {
return 0; return False;
} }
int result = nxagentFontFind(name, &i); Bool result = nxagentFontFind(name, &i);
char *scalable = NULL; char *scalable = NULL;
...@@ -425,9 +425,9 @@ Bool nxagentFontLookUp(const char *name) ...@@ -425,9 +425,9 @@ Bool nxagentFontLookUp(const char *name)
* Let's try with the scalable font description. * Let's try with the scalable font description.
*/ */
if (result == 0) if (!result)
{ {
if ((scalable = nxagentMakeScalableFontName(name, 0)) != NULL) if ((scalable = nxagentMakeScalableFontName(name, False)) != NULL)
{ {
result = nxagentFontFind(scalable, &i); result = nxagentFontFind(scalable, &i);
...@@ -439,9 +439,9 @@ Bool nxagentFontLookUp(const char *name) ...@@ -439,9 +439,9 @@ Bool nxagentFontLookUp(const char *name)
* Let's try again after replacing zero to xdpi and ydpi in the pattern. * Let's try again after replacing zero to xdpi and ydpi in the pattern.
*/ */
if (result == 0) if (!result)
{ {
if ((scalable = nxagentMakeScalableFontName(name, 1)) != NULL) if ((scalable = nxagentMakeScalableFontName(name, True)) != NULL)
{ {
result = nxagentFontFind(scalable, &i); result = nxagentFontFind(scalable, &i);
...@@ -449,9 +449,9 @@ Bool nxagentFontLookUp(const char *name) ...@@ -449,9 +449,9 @@ Bool nxagentFontLookUp(const char *name)
} }
} }
if (result == 0) if (!result)
{ {
return 0; return False;
} }
else else
{ {
...@@ -612,7 +612,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) ...@@ -612,7 +612,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (nxagentFontPriv(pFont)->font_struct == NULL) if (nxagentFontPriv(pFont)->font_struct == NULL)
{ {
if (nxagentFontLookUp(name) == False) if (!nxagentFontLookUp(name))
{ {
fprintf(stderr, "Font: nxagentRealizeFont failed with font Font=%s, not in our remote list\n", fprintf(stderr, "Font: nxagentRealizeFont failed with font Font=%s, not in our remote list\n",
validateString(name)); validateString(name));
...@@ -750,7 +750,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP ...@@ -750,7 +750,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
if (numFontFields <= FIELDS) if (numFontFields <= FIELDS)
{ {
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Font name in non standard format.\n"); fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Font name in non standard format.\n");
} }
...@@ -817,7 +817,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP ...@@ -817,7 +817,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
} }
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Failed to load font '%s'. Replacing with '%s'.\n", fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Failed to load font '%s'. Replacing with '%s'.\n",
fontName, substFontBuf); fontName, substFontBuf);
...@@ -1532,7 +1532,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo ...@@ -1532,7 +1532,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf(stderr, "nxagentLoadQueryFont: Looking for font '%s'.\n", name); fprintf(stderr, "nxagentLoadQueryFont: Looking for font '%s'.\n", name);
#endif #endif
if (nxagentFontLookUp(name) == 0) if (!nxagentFontLookUp(name))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name); fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name);
...@@ -1630,7 +1630,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1630,7 +1630,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
char *current = string; char *current = string;
int i = 0; int i = 0;
int last = 0; Bool last = False;
for (;;) for (;;)
{ {
...@@ -1644,7 +1644,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1644,7 +1644,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
if (next == NULL) if (next == NULL)
{ {
next = string + len; next = string + len;
last = 1; last = True;
} }
int fieldlen = next - current; int fieldlen = next - current;
...@@ -1662,7 +1662,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1662,7 +1662,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
i++; i++;
if (last == 1) if (last)
{ {
break; break;
} }
...@@ -1671,7 +1671,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1671,7 +1671,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
return i; return i;
} }
char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) char *nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution)
{ {
char *scalableFontName; char *scalableFontName;
...@@ -1710,7 +1710,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) ...@@ -1710,7 +1710,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
strcat(scalableFontName, "-0"); strcat(scalableFontName, "-0");
} }
else if (scalableResolution == 1 && (field == 8 || field == 9)) else if (scalableResolution && (field == 8 || field == 9))
{ {
/* /*
* RESOLUTION_X || RESOLUTION_Y * RESOLUTION_X || RESOLUTION_Y
......
...@@ -86,7 +86,7 @@ GCPtr nxagentCreateGraphicContext(int depth); ...@@ -86,7 +86,7 @@ GCPtr nxagentCreateGraphicContext(int depth);
static void nxagentReconnectGC(void*, XID, void*); static void nxagentReconnectGC(void*, XID, void*);
static void nxagentReconnectClip(GCPtr, int, void *, int); static void nxagentReconnectClip(GCPtr, int, void *, int);
static int nxagentCompareRegions(RegionPtr, RegionPtr); static Bool nxagentCompareRegions(RegionPtr, RegionPtr);
struct nxagentGCRec struct nxagentGCRec
{ {
...@@ -317,7 +317,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -317,7 +317,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
else else
{ {
if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized && if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized &&
nxagentGCTrap == 0) !nxagentGCTrap)
{ {
/* /*
* If the tile is corrupted and is not too large, it can be * If the tile is corrupted and is not too large, it can be
...@@ -367,7 +367,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -367,7 +367,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
if (mask & GCStipple) if (mask & GCStipple)
{ {
if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized && if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized &&
nxagentGCTrap == 0) !nxagentGCTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n", fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n",
...@@ -425,7 +425,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -425,7 +425,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
{ {
mask &= ~GCDashList; mask &= ~GCDashList;
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetDashes(nxagentDisplay, nxagentGC(pGC), XSetDashes(nxagentDisplay, nxagentGC(pGC),
pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList); pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
...@@ -434,7 +434,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -434,7 +434,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
CHECKGCVAL(GCArcMode, arc_mode, pGC->arcMode); CHECKGCVAL(GCArcMode, arc_mode, pGC->arcMode);
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n", fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n",
...@@ -497,7 +497,7 @@ void nxagentDestroyGC(GCPtr pGC) ...@@ -497,7 +497,7 @@ void nxagentDestroyGC(GCPtr pGC)
void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{ {
int clipsMatch = 0; Bool clipsMatch = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeClip: Going to change clip on GC [%p]\n", fprintf(stderr, "nxagentChangeClip: Going to change clip on GC [%p]\n",
...@@ -528,7 +528,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -528,7 +528,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
default: default:
{ {
clipsMatch = 0; clipsMatch = False;
break; break;
} }
} }
...@@ -544,7 +544,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -544,7 +544,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{ {
case CT_NONE: case CT_NONE:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
} }
...@@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_REGION: case CT_REGION:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XRectangle *pRects; XRectangle *pRects;
nRects = RegionNumRects((RegionPtr)pValue); nRects = RegionNumRects((RegionPtr)pValue);
...@@ -576,7 +576,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -576,7 +576,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_PIXMAP: case CT_PIXMAP:
{ {
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), XSetClipMask(nxagentDisplay, nxagentGC(pGC),
nxagentPixmap((PixmapPtr)pValue)); nxagentPixmap((PixmapPtr)pValue));
...@@ -594,7 +594,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -594,7 +594,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_UNSORTED: case CT_UNSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -604,7 +604,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -604,7 +604,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YSORTED: case CT_YSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -614,7 +614,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -614,7 +614,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YXSORTED: case CT_YXSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -624,7 +624,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -624,7 +624,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YXBANDED: case CT_YXBANDED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -679,7 +679,7 @@ void nxagentDestroyClip(GCPtr pGC) ...@@ -679,7 +679,7 @@ void nxagentDestroyClip(GCPtr pGC)
nxagentDestroyClipHelper(pGC); nxagentDestroyClipHelper(pGC);
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
} }
...@@ -1209,29 +1209,29 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -1209,29 +1209,29 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
nxagentGCPriv(pGC)->nClipRects = nRects; nxagentGCPriv(pGC)->nClipRects = nRects;
} }
static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) static Bool nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
{ {
/* /*
* It returns 1 if regions are equal, 0 otherwise * It returns True if regions are equal, False otherwise
*/ */
if (r1 == NULL && r2 == NULL) if (r1 == NULL && r2 == NULL)
{ {
return 1; return True;
} }
if ((r1 == NULL) || (r2 == NULL)) if ((r1 == NULL) || (r2 == NULL))
{ {
return 0; return False;
} }
if (RegionNumRects(r1) != RegionNumRects(r2)) if (RegionNumRects(r1) != RegionNumRects(r2))
{ {
return 0; return False;
} }
else if (RegionNumRects(r1) == 0) else if (RegionNumRects(r1) == 0)
{ {
return 1; return True;
} }
else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0; else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0;
else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0; else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0;
...@@ -1247,7 +1247,7 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) ...@@ -1247,7 +1247,7 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0; else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0;
} }
} }
return 1; return True;
} }
/* /*
......
...@@ -211,18 +211,18 @@ RegionPtr nxagentBitBlitHelper(GC *pGC) ...@@ -211,18 +211,18 @@ RegionPtr nxagentBitBlitHelper(GC *pGC)
* redirect property. * redirect property.
*/ */
int nxagentWindowIsPopup(DrawablePtr pDrawable) Bool nxagentWindowIsPopup(DrawablePtr pDrawable)
{ {
if (pDrawable -> type != DRAWABLE_WINDOW) if (pDrawable -> type != DRAWABLE_WINDOW)
{ {
return 0; return 0;
} }
int windowIsPopup = 0; Bool windowIsPopup = False;
if (((WindowPtr) pDrawable) -> overrideRedirect == 1) if (((WindowPtr) pDrawable) -> overrideRedirect == 1)
{ {
windowIsPopup = 1; windowIsPopup = True;
} }
else else
{ {
...@@ -244,7 +244,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) ...@@ -244,7 +244,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable)
if (parent -> overrideRedirect == 1) if (parent -> overrideRedirect == 1)
{ {
windowIsPopup = 1; windowIsPopup = True;
break; break;
} }
...@@ -254,17 +254,17 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) ...@@ -254,17 +254,17 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable)
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentWindowIsPopup: Window [%p] %s to be a popup.\n", (void *) pDrawable, fprintf(stderr, "nxagentWindowIsPopup: Window [%p] %s to be a popup.\n", (void *) pDrawable,
windowIsPopup == 1 ? "seems" : "does not seem"); windowIsPopup ? "seems" : "does not seem");
#endif #endif
return windowIsPopup; return windowIsPopup;
} }
/* /*
* This function returns 1 if the XCopyArea request must be skipped. * This function returns True if the XCopyArea request must be skipped.
*/ */
int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, Bool nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
GCPtr pGC, int srcx, int srcy, int width, GCPtr pGC, int srcx, int srcy, int width,
int height, int dstx, int dsty) int height, int dstx, int dsty)
{ {
...@@ -285,7 +285,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -285,7 +285,7 @@ FIXME: The popup could be synchronized with one single put image,
if (nxagentOption(DeferLevel) >= 2 && if (nxagentOption(DeferLevel) >= 2 &&
pSrcDrawable -> type == DRAWABLE_PIXMAP && pSrcDrawable -> type == DRAWABLE_PIXMAP &&
nxagentPixmapContainTrapezoids((PixmapPtr) pSrcDrawable) == 1 && nxagentPixmapContainTrapezoids((PixmapPtr) pSrcDrawable) == 1 &&
nxagentWindowIsPopup(pDstDrawable) == 1) nxagentWindowIsPopup(pDstDrawable))
{ {
RegionPtr pSrcRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, width, height); RegionPtr pSrcRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, width, height);
...@@ -301,7 +301,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -301,7 +301,7 @@ FIXME: The popup could be synchronized with one single put image,
RegionIntersect(&corruptedRegion, RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (RegionNil(&corruptedRegion) == 0) if (!RegionNil(&corruptedRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n",
...@@ -317,7 +317,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -317,7 +317,7 @@ FIXME: The popup could be synchronized with one single put image,
if (nxagentDrawableStatus(pSrcDrawable) == Synchronized) if (nxagentDrawableStatus(pSrcDrawable) == Synchronized)
{ {
return 0; return False;
} }
} }
...@@ -422,17 +422,17 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -422,17 +422,17 @@ FIXME: The popup could be synchronized with one single put image,
* corrupted region. * corrupted region.
*/ */
if (RegionNil(pClipRegion) == 0) if (!RegionNil(pClipRegion))
{ {
nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion); nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion);
} }
if (RegionNil(pCorruptedRegion) == 0) if (!RegionNil(pCorruptedRegion))
{ {
nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion); nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion);
} }
if (RegionNil(pClipRegion) == 0) if (!RegionNil(pClipRegion))
{ {
Bool pClipRegionFree = True; Bool pClipRegionFree = True;
...@@ -509,7 +509,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -509,7 +509,7 @@ FIXME: The popup could be synchronized with one single put image,
nxagentChangeClip(targetGC, CT_NONE, NullRegion, 0); nxagentChangeClip(targetGC, CT_NONE, NullRegion, 0);
if (pClipRegionFree == True) if (pClipRegionFree)
{ {
nxagentFreeRegion(pClipRegion); nxagentFreeRegion(pClipRegion);
} }
...@@ -532,7 +532,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -532,7 +532,7 @@ FIXME: The popup could be synchronized with one single put image,
nxagentFreeRegion(pCorruptedRegion); nxagentFreeRegion(pCorruptedRegion);
return 1; return True;
} }
else else
{ {
...@@ -550,7 +550,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -550,7 +550,7 @@ FIXME: The popup could be synchronized with one single put image,
RegionIntersect(&corruptedRegion, RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (RegionNil(&corruptedRegion) == 0) if (!RegionNil(&corruptedRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n",
...@@ -565,14 +565,14 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -565,14 +565,14 @@ FIXME: The popup could be synchronized with one single put image,
nxagentFreeRegion(pSrcRegion); nxagentFreeRegion(pSrcRegion);
} }
return 0; return False;
} }
RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
GCPtr pGC, int srcx, int srcy, int width, GCPtr pGC, int srcx, int srcy, int width,
int height, int dstx, int dsty) int height, int dstx, int dsty)
{ {
int skip = 0; Bool skip = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCopyArea: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", fprintf(stderr, "nxagentCopyArea: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n",
...@@ -664,7 +664,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -664,7 +664,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
} }
if (nxagentGCTrap == 1 || nxagentShmTrap == 1) if (nxagentGCTrap || nxagentShmTrap)
{ {
if (pSrcDrawable -> type == DRAWABLE_PIXMAP && if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
pDstDrawable -> type == DRAWABLE_PIXMAP) pDstDrawable -> type == DRAWABLE_PIXMAP)
...@@ -698,9 +698,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -698,9 +698,9 @@ 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) ||
(nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0)))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCopyArea: Prevented operation on fully obscured window at [%p].\n", fprintf(stderr, "nxagentCopyArea: Prevented operation on fully obscured window at [%p].\n",
...@@ -761,7 +761,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -761,7 +761,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
* can skip the copy area operation. * can skip the copy area operation.
*/ */
skip = 1; skip = True;
} }
#ifdef TEST #ifdef TEST
...@@ -771,7 +771,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -771,7 +771,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
(void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height);
#endif #endif
if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized)
{ {
skip = nxagentDeferCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, skip = nxagentDeferCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
width, height, dstx, dsty); width, height, dstx, dsty);
...@@ -784,7 +784,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -784,7 +784,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
} }
#endif #endif
if (skip == 0) if (!skip)
{ {
XCopyArea(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), XCopyArea(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable),
nxagentGC(pGC), srcx, srcy, width, height, dstx, dsty); nxagentGC(pGC), srcx, srcy, width, height, dstx, dsty);
...@@ -881,7 +881,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -881,7 +881,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
GCPtr pGC, int srcx, int srcy, int width, int height, GCPtr pGC, int srcx, int srcy, int width, int height,
int dstx, int dsty, unsigned long plane) int dstx, int dsty, unsigned long plane)
{ {
int skip = 0; Bool skip = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCopyPlane: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", fprintf(stderr, "nxagentCopyPlane: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n",
...@@ -890,7 +890,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -890,7 +890,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
(void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height);
#endif #endif
if (nxagentGCTrap == 1 || nxagentShmTrap == 1) if (nxagentGCTrap || nxagentShmTrap)
{ {
if (pSrcDrawable -> type == DRAWABLE_PIXMAP && if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
pDstDrawable -> type == DRAWABLE_PIXMAP) pDstDrawable -> type == DRAWABLE_PIXMAP)
...@@ -969,10 +969,10 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -969,10 +969,10 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
* can skip the copy plane operation. * can skip the copy plane operation.
*/ */
skip = 1; skip = True;
} }
if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized)
{ {
if (pDstDrawable -> type == DRAWABLE_PIXMAP && if (pDstDrawable -> type == DRAWABLE_PIXMAP &&
nxagentOption(DeferLevel) > 0) nxagentOption(DeferLevel) > 0)
...@@ -983,7 +983,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -983,7 +983,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
nxagentFreeRegion(pDstRegion); nxagentFreeRegion(pDstRegion);
skip = 1; skip = True;
} }
else else
{ {
...@@ -996,7 +996,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -996,7 +996,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
RegionIntersect(&corruptedRegion, RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (RegionNil(&corruptedRegion) == 0) if (!RegionNil(&corruptedRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n", fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n",
...@@ -1025,7 +1025,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -1025,7 +1025,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
} }
#endif #endif
if (skip == 0) if (!skip)
{ {
XCopyPlane(nxagentDisplay, XCopyPlane(nxagentDisplay,
nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable),
...@@ -1073,7 +1073,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, ...@@ -1073,7 +1073,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
(void *) pDrawable, (void *) pGC, nPoints); (void *) pDrawable, (void *) pGC, nPoints);
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1130,7 +1130,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, ...@@ -1130,7 +1130,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode, void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode,
int nPoints, xPoint *pPoints) int nPoints, xPoint *pPoints)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1203,7 +1203,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1203,7 +1203,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC,
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1280,7 +1280,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1280,7 +1280,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1345,7 +1345,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1345,7 +1345,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC,
int nArcs, xArc *pArcs) int nArcs, xArc *pArcs)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1404,7 +1404,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, ...@@ -1404,7 +1404,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
{ {
xPoint *newPoints = NULL; xPoint *newPoints = NULL;
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1518,7 +1518,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1518,7 +1518,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
#endif #endif
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1540,7 +1540,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1540,7 +1540,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
* will be cleared. * will be cleared.
*/ */
int inheritCorruptedRegion = 0; Bool inheritCorruptedRegion = False;
if (pGC -> fillStyle == FillTiled && if (pGC -> fillStyle == FillTiled &&
pGC -> tileIsPixel == 0 && pGC -> tile.pixmap != NULL) pGC -> tileIsPixel == 0 && pGC -> tile.pixmap != NULL)
...@@ -1556,11 +1556,11 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1556,11 +1556,11 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
#endif #endif
inheritCorruptedRegion = 1; inheritCorruptedRegion = True;
} }
} }
if (inheritCorruptedRegion == 1 || nxagentDrawableStatus(pDrawable) == NotSynchronized) if (inheritCorruptedRegion || nxagentDrawableStatus(pDrawable) == NotSynchronized)
{ {
RegionPtr rectRegion = RegionFromRects(nRectangles, pRectangles, CT_REGION); RegionPtr rectRegion = RegionFromRects(nRectangles, pRectangles, CT_REGION);
...@@ -1582,7 +1582,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1582,7 +1582,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
RegionUninit(&tmpRegion); RegionUninit(&tmpRegion);
} }
if (inheritCorruptedRegion == 1) if (inheritCorruptedRegion)
{ {
/* /*
* The fill style should affect the corrupted region * The fill style should affect the corrupted region
...@@ -1663,7 +1663,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1663,7 +1663,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
int nArcs, xArc *pArcs) int nArcs, xArc *pArcs)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1739,7 +1739,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1739,7 +1739,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x,
int width = XTextWidth(nxagentFontStruct(pGC->font), string, count); int width = XTextWidth(nxagentFontStruct(pGC->font), string, count);
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1809,7 +1809,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1809,7 +1809,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x,
int width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count); int width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count);
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1868,7 +1868,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1868,7 +1868,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x,
void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, char *string) int y, int count, char *string)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
...@@ -1925,7 +1925,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1925,7 +1925,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x,
void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, unsigned short *string) int y, int count, unsigned short *string)
{ {
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
if ((pDrawable)->type == DRAWABLE_PIXMAP) if ((pDrawable)->type == DRAWABLE_PIXMAP)
{ {
......
...@@ -114,15 +114,15 @@ extern void nxagentDumpInputDevicesState(void); ...@@ -114,15 +114,15 @@ extern void nxagentDumpInputDevicesState(void);
* Used in the handling of the X desktop manager protocol. * Used in the handling of the X desktop manager protocol.
*/ */
int nxagentXdmcpUp = 0; Bool nxagentXdmcpUp = False;
int nxagentXdmcpAlertUp = 0; Bool nxagentXdmcpAlertUp = False;
/* /*
* Also used in the block, wakeup and sync handlers. * Also used in the block, wakeup and sync handlers.
*/ */
int nxagentBuffer; int nxagentBuffer;
int nxagentBlocking; Bool nxagentBlocking;
int nxagentCongestion; int nxagentCongestion;
double nxagentBytesIn; double nxagentBytesIn;
...@@ -153,7 +153,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 }; ...@@ -153,7 +153,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 };
* server. * server.
*/ */
extern int nxagentSkipImage; extern Bool nxagentSkipImage;
void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
{ {
...@@ -179,7 +179,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -179,7 +179,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* Set if we need to synchronize any drawable. * Set if we need to synchronize any drawable.
*/ */
static int synchronize; static Bool synchronize;
#ifdef BLOCKS #ifdef BLOCKS
fprintf(stderr, "[Begin block]\n"); fprintf(stderr, "[Begin block]\n");
...@@ -199,7 +199,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -199,7 +199,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif #endif
if (nxagentNeedConnectionChange() == 1) if (nxagentNeedConnectionChange())
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Calling nxagentHandleConnectionChanges " fprintf(stderr, "nxagentBlockHandler: Calling nxagentHandleConnectionChanges "
...@@ -222,7 +222,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -222,7 +222,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#ifdef TEST #ifdef TEST
if (nxagentLastWindowDestroyed == 1) if (nxagentLastWindowDestroyed)
{ {
fprintf(stderr, "nxagentBlockHandler: Elapsed time [%lu].\n", fprintf(stderr, "nxagentBlockHandler: Elapsed time [%lu].\n",
now - nxagentLastWindowDestroyedTime); now - nxagentLastWindowDestroyedTime);
...@@ -302,7 +302,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -302,7 +302,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* are synchronized. * are synchronized.
*/ */
if (synchronize == 1) if (synchronize)
{ {
/* /*
* We should not enter the synchronization loop if there is any * We should not enter the synchronization loop if there is any
...@@ -310,7 +310,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -310,7 +310,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* operation. * operation.
*/ */
if (nxagentForceSynchronization == 1) if (nxagentForceSynchronization)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Going to force a synchronization at %s.\n", fprintf(stderr, "nxagentBlockHandler: Going to force a synchronization at %s.\n",
...@@ -319,10 +319,10 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -319,10 +319,10 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
nxagentSynchronizationLoop(NEVER_BREAK); nxagentSynchronizationLoop(NEVER_BREAK);
nxagentForceSynchronization = 0; nxagentForceSynchronization = False;
} }
else if (nxagentUserInput(NULL) == 0 && else if (nxagentUserInput(NULL) == 0 &&
nxagentBlocking == 0 && !nxagentBlocking &&
nxagentCongestion <= 4) nxagentCongestion <= 4)
{ {
#ifdef TEST #ifdef TEST
...@@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
nxagentCorruptedBackgrounds > 0 || nxagentCorruptedBackgrounds > 0 ||
nxagentCorruptedPixmaps > 0)); nxagentCorruptedPixmaps > 0));
if (nxagentSkipImage == 0 && synchronize == 1) if (!nxagentSkipImage && synchronize)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and " fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and "
...@@ -391,7 +391,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -391,7 +391,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#ifdef DYNAMIC_DISPLAY_BUFFER #ifdef DYNAMIC_DISPLAY_BUFFER
if (nxagentBlocking == 1 && if (nxagentBlocking &&
nxagentBuffer > MINIMUM_DISPLAY_BUFFER) nxagentBuffer > MINIMUM_DISPLAY_BUFFER)
{ {
nxagentBuffer >>= 1; nxagentBuffer >>= 1;
...@@ -587,7 +587,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -587,7 +587,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
* Can become true during the dispatch loop. * Can become true during the dispatch loop.
*/ */
nxagentBlocking = 0; nxagentBlocking = False;
/* /*
* Check if we got new events. * Check if we got new events.
...@@ -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)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState); fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState);
...@@ -656,10 +656,10 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -656,10 +656,10 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
if (XdmcpState == XDM_RUN_SESSION) if (XdmcpState == XDM_RUN_SESSION)
{ {
nxagentXdmcpUp = 1; nxagentXdmcpUp = True;
} }
if (nxagentXdmcpUp == 0) if (!nxagentXdmcpUp)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpTime [%lu].\n", fprintf(stderr, "nxagentWakeupHandler: XdmcpTime [%lu].\n",
...@@ -671,7 +671,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -671,7 +671,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
XdmcpTimeOutRtx); XdmcpTimeOutRtx);
#endif #endif
if (nxagentXdmcpAlertUp == 0 && if (!nxagentXdmcpAlertUp &&
GetTimeInMillis() - XdmcpStartTime >= XDM_TIMEOUT) GetTimeInMillis() - XdmcpStartTime >= XDM_TIMEOUT)
{ {
#ifdef WARNING #ifdef WARNING
...@@ -681,7 +681,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -681,7 +681,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
NXTransAlert(FAILED_XDMCP_CONNECTION_ALERT, NX_ALERT_REMOTE); NXTransAlert(FAILED_XDMCP_CONNECTION_ALERT, NX_ALERT_REMOTE);
nxagentXdmcpAlertUp = 1; nxagentXdmcpAlertUp = True;
} }
} }
} }
...@@ -703,7 +703,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas ...@@ -703,7 +703,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
fprintf(stderr, "[Begin block]\n"); fprintf(stderr, "[Begin block]\n");
#endif #endif
if (nxagentNeedConnectionChange() == 1) if (nxagentNeedConnectionChange())
{ {
nxagentHandleConnectionChanges(); nxagentHandleConnectionChanges();
} }
...@@ -732,9 +732,9 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas ...@@ -732,9 +732,9 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentDispatchEvents(NULL); nxagentDispatchEvents(NULL);
} }
if (nxagentShadowResize == 1) if (nxagentShadowResize)
{ {
nxagentShadowResize = 0; nxagentShadowResize = False;
nxagentShadowAdaptToRatio(); nxagentShadowAdaptToRatio();
} }
...@@ -759,7 +759,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas ...@@ -759,7 +759,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentShadowSendUpdates(&suspended); nxagentShadowSendUpdates(&suspended);
if (nxagentBlocking == 0) if (!nxagentBlocking)
{ {
nxagentSynchronizeDrawable((DrawablePtr) nxagentShadowPixmapPtr, DONT_WAIT, nxagentSynchronizeDrawable((DrawablePtr) nxagentShadowPixmapPtr, DONT_WAIT,
ALWAYS_BREAK, nxagentShadowWindowPtr); ALWAYS_BREAK, nxagentShadowWindowPtr);
...@@ -830,7 +830,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) ...@@ -830,7 +830,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
* Can become true during the dispatch loop. * Can become true during the dispatch loop.
*/ */
nxagentBlocking = 0; nxagentBlocking = False;
/* /*
* Check if we got new events. * Check if we got new events.
...@@ -1200,7 +1200,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) ...@@ -1200,7 +1200,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
nxagentDispatchEvents(NULL); nxagentDispatchEvents(NULL);
nxagentBlocking = 1; nxagentBlocking = True;
} }
/* /*
......
...@@ -37,7 +37,7 @@ extern int nxagentBuffer; ...@@ -37,7 +37,7 @@ extern int nxagentBuffer;
* the display to become writable. * the display to become writable.
*/ */
extern int nxagentBlocking; extern Bool nxagentBlocking;
/* /*
* Current congestion level based on * Current congestion level based on
......
...@@ -403,7 +403,7 @@ FIXME: Here the split trap is always set and so the caching of the ...@@ -403,7 +403,7 @@ FIXME: Here the split trap is always set and so the caching of the
resource, nxagentSplitTrap); resource, nxagentSplitTrap);
#endif #endif
if (nxagentSplitTrap == 1 || nxagentUnpackAlpha[resource] == NULL || if (nxagentSplitTrap || nxagentUnpackAlpha[resource] == NULL ||
nxagentUnpackAlpha[resource] -> size != size || nxagentUnpackAlpha[resource] -> size != size ||
memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0) memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0)
{ {
...@@ -473,8 +473,8 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -473,8 +473,8 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
RegionPtr pRegion = NullRegion; RegionPtr pRegion = NullRegion;
int resource = 0; int resource = 0;
int split = 0; Bool split = False;
int cache = 1; Bool cache = True;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPutImage: Image data at [%p] drawable [%s][%p] geometry [%d,%d,%d,%d].\n", fprintf(stderr, "nxagentPutImage: Image data at [%p] drawable [%s][%p] geometry [%d,%d,%d,%d].\n",
...@@ -524,9 +524,9 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -524,9 +524,9 @@ 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) ||
(nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0)))
{ {
#ifdef TEST #ifdef TEST
...@@ -544,7 +544,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -544,7 +544,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight); pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight);
if (RegionNil(pRegion) == 1) if (RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped " fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped "
...@@ -562,8 +562,8 @@ FIXME: Should use these. ...@@ -562,8 +562,8 @@ FIXME: Should use these.
int framebuffer = 1; int framebuffer = 1;
int realize = 1; int realize = 1;
*/ */
if (nxagentGCTrap == 1 && nxagentReconnectTrap == 0 && if (nxagentGCTrap && !nxagentReconnectTrap &&
nxagentFBTrap == 0 && nxagentShmTrap == 0) !nxagentFBTrap && !nxagentShmTrap)
{ {
if (pDrawable -> type == DRAWABLE_PIXMAP) if (pDrawable -> type == DRAWABLE_PIXMAP)
{ {
...@@ -579,11 +579,11 @@ FIXME: Should use these. ...@@ -579,11 +579,11 @@ FIXME: Should use these.
goto nxagentPutImageEnd; goto nxagentPutImageEnd;
} }
if (nxagentReconnectTrap == 0 && if (!nxagentReconnectTrap &&
nxagentSplitTrap == 0) !nxagentSplitTrap)
{ {
if (pDrawable -> type == DRAWABLE_PIXMAP && if (pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentFBTrap == 0 && nxagentShmTrap == 0) !nxagentFBTrap && !nxagentShmTrap)
{ {
fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth, fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth,
dstX, dstY, dstWidth, dstHeight, leftPad, format, data); dstX, dstY, dstWidth, dstHeight, leftPad, format, data);
...@@ -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
...@@ -683,8 +683,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, we ...@@ -683,8 +683,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, we
/* /*
FIXME: Temporarily stream the GLX data. FIXME: Temporarily stream the GLX data.
&& nxagentGlxTrap == 0 && !nxagentGlxTrap
&& nxagentXvTrap == 0 && !nxagentXvTrap
*/ */
); );
...@@ -692,21 +692,21 @@ FIXME: Temporarily stream the GLX data. ...@@ -692,21 +692,21 @@ FIXME: Temporarily stream the GLX data.
* Never split images whose depth is less than 15. * Never split images whose depth is less than 15.
*/ */
if (split == 1 && (nxagentSplitTrap == 1 || depth < 15)) if (split && (nxagentSplitTrap || depth < 15))
{ {
#ifdef TEST #ifdef TEST
if (nxagentSplitTrap == 1 || if (nxagentSplitTrap ||
nxagentReconnectTrap == 1) nxagentReconnectTrap)
{ {
fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] " fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] "
"depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth);
} }
#endif #endif
split = 0; split = False;
} }
#ifdef TEST #ifdef TEST
else if (split == 1) else if (split)
{ {
fprintf(stderr, "nxagentPutImage: Splitting with reconnection [%d] trap [%d] " fprintf(stderr, "nxagentPutImage: Splitting with reconnection [%d] trap [%d] "
"depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth);
...@@ -714,7 +714,7 @@ FIXME: Temporarily stream the GLX data. ...@@ -714,7 +714,7 @@ FIXME: Temporarily stream the GLX data.
#endif #endif
#ifdef TEST #ifdef TEST
if (split == 1) if (split)
{ {
fprintf(stderr, "nxagentPutImage: Splitting the image with size [%d] " fprintf(stderr, "nxagentPutImage: Splitting the image with size [%d] "
"link [%d] GLX [%d] Xv [%d].\n", length, nxagentOption(LinkType), "link [%d] GLX [%d] Xv [%d].\n", length, nxagentOption(LinkType),
...@@ -734,7 +734,7 @@ FIXME: Temporarily stream the GLX data. ...@@ -734,7 +734,7 @@ FIXME: Temporarily stream the GLX data.
*/ */
if (nxagentOption(LinkType) != LINK_TYPE_NONE && if (nxagentOption(LinkType) != LINK_TYPE_NONE &&
(nxagentGlxTrap == 1 || nxagentXvTrap == 1)) (nxagentGlxTrap || nxagentXvTrap))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPutImage: Disabling the use of the cache with GLX or Xvideo.\n"); fprintf(stderr, "nxagentPutImage: Disabling the use of the cache with GLX or Xvideo.\n");
...@@ -742,7 +742,7 @@ FIXME: Temporarily stream the GLX data. ...@@ -742,7 +742,7 @@ FIXME: Temporarily stream the GLX data.
NXSetCacheParameters(nxagentDisplay, 0, 1, 0, 0); NXSetCacheParameters(nxagentDisplay, 0, 1, 0, 0);
cache = 0; cache = False;
} }
/* /*
...@@ -750,7 +750,7 @@ FIXME: Temporarily stream the GLX data. ...@@ -750,7 +750,7 @@ FIXME: Temporarily stream the GLX data.
* tell us if the split took place. * tell us if the split took place.
*/ */
if (split == 1) if (split)
{ {
/* /*
* If the drawable is already being split, expand the * If the drawable is already being split, expand the
...@@ -793,7 +793,7 @@ FIXME: Should probably intersect the region with the region being ...@@ -793,7 +793,7 @@ FIXME: Should probably intersect the region with the region being
nxagentRealizeImage(pDrawable, pGC, depth, dstX, dstY, nxagentRealizeImage(pDrawable, pGC, depth, dstX, dstY,
dstWidth, dstHeight, leftPad, format, data); dstWidth, dstHeight, leftPad, format, data);
if (split == 1) if (split)
{ {
NXEndSplit(nxagentDisplay, resource); NXEndSplit(nxagentDisplay, resource);
...@@ -807,7 +807,7 @@ FIXME: Should probably intersect the region with the region being ...@@ -807,7 +807,7 @@ FIXME: Should probably intersect the region with the region being
split = nxagentWaitSplitEvent(resource); split = nxagentWaitSplitEvent(resource);
if (split == 1) if (split)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPutImage: Marking corrupted region [%d,%d,%d,%d] for drawable at [%p].\n", fprintf(stderr, "nxagentPutImage: Marking corrupted region [%d,%d,%d,%d] for drawable at [%p].\n",
...@@ -838,7 +838,7 @@ FIXME: Should probably intersect the region with the region being ...@@ -838,7 +838,7 @@ FIXME: Should probably intersect the region with the region being
* above, so here we have to check the value again. * above, so here we have to check the value again.
*/ */
if (split == 0) if (!split)
{ {
if (nxagentDrawableStatus(pDrawable) == NotSynchronized) if (nxagentDrawableStatus(pDrawable) == NotSynchronized)
{ {
...@@ -863,7 +863,7 @@ nxagentPutImageEnd: ...@@ -863,7 +863,7 @@ nxagentPutImageEnd:
* Check if we disabled caching. * Check if we disabled caching.
*/ */
if (cache == 0) if (!cache)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPutImage: Reenabling the use of the cache.\n"); fprintf(stderr, "nxagentPutImage: Reenabling the use of the cache.\n");
...@@ -925,7 +925,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -925,7 +925,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
int bytesPerLine = nxagentImagePad(w, format, leftPad, depth); int bytesPerLine = nxagentImagePad(w, format, leftPad, depth);
if (nxagentOption(Shadow) == 1 && format == ZPixmap && if (nxagentOption(Shadow) && format == ZPixmap &&
(nxagentOption(XRatio) != DONT_SCALE || (nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE) && nxagentOption(YRatio) != DONT_SCALE) &&
pDrawable == (DrawablePtr) nxagentShadowPixmapPtr) pDrawable == (DrawablePtr) nxagentShadowPixmapPtr)
...@@ -987,7 +987,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -987,7 +987,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h); clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h);
} }
if (clipRegion == NullRegion || RegionNil(clipRegion) == 0) if (clipRegion == NullRegion || !RegionNil(clipRegion))
{ {
nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h, nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h,
leftPad, format, data, pVisual); leftPad, format, data, pVisual);
...@@ -1041,9 +1041,9 @@ void nxagentPutSubImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -1041,9 +1041,9 @@ void nxagentPutSubImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
ClientPtr client; ClientPtr client;
int lossless = 0; Bool lossless = False;
int clean = 0; Bool clean = False;
int pack = 0; Bool pack = False;
/* /*
* XCreateImage is the place where the leftPad should be passed. * XCreateImage is the place where the leftPad should be passed.
...@@ -1136,7 +1136,7 @@ FIXME: Should use an unpack resource here. ...@@ -1136,7 +1136,7 @@ FIXME: Should use an unpack resource here.
lossless = (packMethod == nxagentPackLossless); lossless = (packMethod == nxagentPackLossless);
if (pack == 1 && lossless == 0) if (pack && !lossless)
{ {
/* /*
* Force the image to be sent as a plain bitmap if we don't have * Force the image to be sent as a plain bitmap if we don't have
...@@ -1145,7 +1145,7 @@ FIXME: Should use an unpack resource here. ...@@ -1145,7 +1145,7 @@ FIXME: Should use an unpack resource here.
if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT || if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT ||
nxagentImageLength(w, h, format, leftPad, depth) <= nxagentImageLength(w, h, format, leftPad, depth) <=
IMAGE_PACK_LENGTH || nxagentLosslessTrap == 1) IMAGE_PACK_LENGTH || nxagentLosslessTrap)
{ {
if (nxagentPackLossless == PACK_NONE) if (nxagentPackLossless == PACK_NONE)
{ {
...@@ -1155,7 +1155,7 @@ FIXME: Should use an unpack resource here. ...@@ -1155,7 +1155,7 @@ FIXME: Should use an unpack resource here.
nxagentImageLength(w, h, format, leftPad, depth)); nxagentImageLength(w, h, format, leftPad, depth));
#endif #endif
pack = 0; pack = False;
} }
else else
{ {
...@@ -1167,7 +1167,7 @@ FIXME: Should use an unpack resource here. ...@@ -1167,7 +1167,7 @@ FIXME: Should use an unpack resource here.
packMethod = nxagentPackLossless; packMethod = nxagentPackLossless;
lossless = 1; lossless = True;
} }
} }
} }
...@@ -1176,7 +1176,7 @@ FIXME: Should use an unpack resource here. ...@@ -1176,7 +1176,7 @@ FIXME: Should use an unpack resource here.
* Do we still want to pack the image? * Do we still want to pack the image?
*/ */
if (pack == 1) if (pack)
{ {
/* /*
* Set the geometry and alpha channel to be used for the unpacked * Set the geometry and alpha channel to be used for the unpacked
...@@ -1219,8 +1219,8 @@ FIXME: Should try to locate the image anyway, if the lossless trap is ...@@ -1219,8 +1219,8 @@ FIXME: Should try to locate the image anyway, if the lossless trap is
method. method.
*/ */
if (nxagentNeedCache(plainImage, packMethod) && if (nxagentNeedCache(plainImage, packMethod) &&
nxagentGlxTrap == 0 && nxagentXvTrap == 0 && !nxagentGlxTrap && !nxagentXvTrap &&
nxagentLosslessTrap == 0 && NXImageCacheSize > 0) !nxagentLosslessTrap && NXImageCacheSize > 0)
{ {
/* /*
* Be sure that the padding bits are cleaned before calculating * Be sure that the padding bits are cleaned before calculating
...@@ -1234,7 +1234,7 @@ FIXME: There should be a callback registered by the agent that ...@@ -1234,7 +1234,7 @@ FIXME: There should be a callback registered by the agent that
etc. This statistics report would be included by the proxy in etc. This statistics report would be included by the proxy in
its stat output. its stat output.
*/ */
clean = 1; clean = True;
NXCleanImage(plainImage); NXCleanImage(plainImage);
...@@ -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 && nxagentOption(Adaptive))
{ {
int ratio = nxagentUniquePixels(plainImage); int ratio = nxagentUniquePixels(plainImage);
...@@ -1297,7 +1297,7 @@ FIXME: There should be a callback registered by the agent that ...@@ -1297,7 +1297,7 @@ FIXME: There should be a callback registered by the agent that
packMethod = nxagentPackLossless; packMethod = nxagentPackLossless;
lossless = 1; lossless = True;
} }
#ifdef TEST #ifdef TEST
else else
...@@ -1324,11 +1324,11 @@ FIXME: There should be a callback registered by the agent that ...@@ -1324,11 +1324,11 @@ FIXME: There should be a callback registered by the agent that
* bitwise the same regardless the padding bits. * bitwise the same regardless the padding bits.
*/ */
if (clean == 0) if (!clean)
{ {
if (nxagentNeedClean(plainImage, packMethod) == 1) if (nxagentNeedClean(plainImage, packMethod) == 1)
{ {
clean = 1; clean = True;
NXCleanImage(plainImage); NXCleanImage(plainImage);
} }
...@@ -1448,12 +1448,12 @@ FIXME: If we failed to encode the image by any of the available ...@@ -1448,12 +1448,12 @@ FIXME: If we failed to encode the image by any of the available
was sent in the unpack alpha message. This can be done here, if was sent in the unpack alpha message. This can be done here, if
the clean flag is true and we are going to send a plain image. the clean flag is true and we are going to send a plain image.
*/ */
if (clean == 0) if (!clean)
{ {
clean = (nxagentOption(LinkType) != LINK_TYPE_NONE && clean = (nxagentOption(LinkType) != LINK_TYPE_NONE &&
nxagentOption(LinkType) != LINK_TYPE_LAN && depth != 32); nxagentOption(LinkType) != LINK_TYPE_LAN && depth != 32);
if (clean == 1) if (clean)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentPutSubImage: Cleaning the image with link type [%d] and depth [%d].\n", fprintf(stderr, "nxagentPutSubImage: Cleaning the image with link type [%d] and depth [%d].\n",
......
...@@ -171,7 +171,7 @@ int nxagentSaveUnder; ...@@ -171,7 +171,7 @@ int nxagentSaveUnder;
* nxagentOpenScreen * nxagentOpenScreen
* InitInput * InitInput
*/ */
int nxagentDoFullGeneration = 1; Bool nxagentDoFullGeneration = True;
/* /*
* True if agent is running as X2goAgent * True if agent is running as X2goAgent
...@@ -251,7 +251,7 @@ void InitOutput(ScreenInfo *scrInfo, int argc, char *argv[]) ...@@ -251,7 +251,7 @@ void InitOutput(ScreenInfo *scrInfo, int argc, char *argv[])
AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL); AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL);
} }
if (nxagentUserDefinedFontPath == 0) if (!nxagentUserDefinedFontPath)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "InitOutput: Calling nxagentVerifyDefaultFontPath.\n"); fprintf(stderr, "InitOutput: Calling nxagentVerifyDefaultFontPath.\n");
...@@ -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);
......
...@@ -161,7 +161,7 @@ XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 }; ...@@ -161,7 +161,7 @@ XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 };
* Keyboard status, updated through XKB events. * Keyboard status, updated through XKB events.
*/ */
XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, 0 }; XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, False };
/* /*
* Info for disabling/enabling Xkb extension. * Info for disabling/enabling Xkb extension.
...@@ -776,7 +776,7 @@ XkbError: ...@@ -776,7 +776,7 @@ XkbError:
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
} }
if (nxagentOption(Shadow) == 1 && pDev && pDev->key) if (nxagentOption(Shadow) && pDev && pDev->key)
{ {
NXShadowInitKeymap(&(pDev->key->curKeySyms)); NXShadowInitKeymap(&(pDev->key->curKeySyms));
} }
...@@ -974,7 +974,7 @@ int nxagentResetKeyboard(void) ...@@ -974,7 +974,7 @@ int nxagentResetKeyboard(void)
if (dev->key) if (dev->key)
{ {
#ifdef XKB #ifdef XKB
if (noXkbExtension == 0 && dev->key->xkbInfo) if (!noXkbExtension && dev->key->xkbInfo)
{ {
oldMinKeycode = dev->key->xkbInfo -> desc -> min_key_code; oldMinKeycode = dev->key->xkbInfo -> desc -> min_key_code;
oldMaxKeycode = dev->key->xkbInfo -> desc -> max_key_code; oldMaxKeycode = dev->key->xkbInfo -> desc -> max_key_code;
...@@ -1132,7 +1132,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) ...@@ -1132,7 +1132,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
if (dev->key) if (dev->key)
{ {
#ifdef XKB #ifdef XKB
if (noXkbExtension == 0 && dev->key->xkbInfo) if (!noXkbExtension && dev->key->xkbInfo)
{ {
XkbFreeInfo(dev->key->xkbInfo); XkbFreeInfo(dev->key->xkbInfo);
dev->key->xkbInfo = NULL; dev->key->xkbInfo = NULL;
......
...@@ -68,8 +68,7 @@ typedef struct _XkbAgentState ...@@ -68,8 +68,7 @@ typedef struct _XkbAgentState
int Caps; int Caps;
int Num; int Num;
int Focus; int Focus;
int Initialized; Bool Initialized;
} XkbAgentStateRec; } XkbAgentStateRec;
extern XkbAgentStateRec nxagentXkbState; extern XkbAgentStateRec nxagentXkbState;
......
...@@ -624,7 +624,7 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -624,7 +624,7 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
return True; return True;
break; break;
case KEYSTROKE_FORCE_SYNCHRONIZATION: case KEYSTROKE_FORCE_SYNCHRONIZATION:
nxagentForceSynchronization = 1; nxagentForceSynchronization = True;
break; break;
#ifdef DUMP #ifdef DUMP
case KEYSTROKE_REGIONS_ON_SCREEN: case KEYSTROKE_REGIONS_ON_SCREEN:
......
...@@ -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))
{ {
#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))
{ {
#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",
...@@ -575,7 +575,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -575,7 +575,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString()); fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString());
} }
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
NXShadowDestroy(); NXShadowDestroy();
} }
......
...@@ -189,7 +189,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, ...@@ -189,7 +189,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
* } * }
*/ */
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
/* /*
* from nxagent-1.5.0-20 changelog: * from nxagent-1.5.0-20 changelog:
...@@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) ...@@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse)
* by the agent (for example if the focus had left the window), so * by the agent (for example if the focus had left the window), so
* that agent could be unable to update the mouse button state. * that agent could be unable to update the mouse button state.
*/ */
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
XUngrabPointer(nxagentDisplay, CurrentTime); XUngrabPointer(nxagentDisplay, CurrentTime);
......
...@@ -193,7 +193,7 @@ ProcChangeProperty(ClientPtr client) ...@@ -193,7 +193,7 @@ ProcChangeProperty(ClientPtr client)
return err; return err;
else else
{ {
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format,
(int) mode, len, (void *) &stuff[1]); (int) mode, len, (void *) &stuff[1]);
......
...@@ -551,8 +551,8 @@ int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst) ...@@ -551,8 +551,8 @@ int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst)
fprintf(stderr, "nxagentCompositePredicate: Case 1.\n"); fprintf(stderr, "nxagentCompositePredicate: Case 1.\n");
#endif #endif
if (nxagentPixmapIsVirtual(pPixmap1) == 1 && if (nxagentPixmapIsVirtual(pPixmap1) &&
nxagentPixmapIsVirtual(pPixmap2) == 1) nxagentPixmapIsVirtual(pPixmap2))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCompositePredicate: Case 2.\n"); fprintf(stderr, "nxagentCompositePredicate: Case 2.\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;
} }
......
...@@ -392,7 +392,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP ...@@ -392,7 +392,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) && if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) &&
pWin -> overrideRedirect == 0 && pWin -> overrideRedirect == 0 &&
nxagentScreenTrap == 0) !nxagentScreenTrap)
{ {
nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask); nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask);
......
...@@ -59,10 +59,12 @@ void nxagentInitOptions(void) ...@@ -59,10 +59,12 @@ void nxagentInitOptions(void)
{ {
nxagentOptions.LinkType = UNDEFINED; nxagentOptions.LinkType = UNDEFINED;
nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Desktop = True;
nxagentOptions.Persistent = 1; nxagentOptions.Persistent = True;
nxagentOptions.Rootless = UNDEFINED; nxagentOptions.Rootless = False;
nxagentOptions.Fullscreen = UNDEFINED; nxagentOptions.Shadow = False;
nxagentOptions.Fullscreen = False;
nxagentOptions.AllScreens = False;
nxagentOptions.NoRootlessExit = False; nxagentOptions.NoRootlessExit = False;
nxagentOptions.X = 0; nxagentOptions.X = 0;
...@@ -81,23 +83,23 @@ void nxagentInitOptions(void) ...@@ -81,23 +83,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;
...@@ -107,7 +109,7 @@ void nxagentInitOptions(void) ...@@ -107,7 +109,7 @@ void nxagentInitOptions(void)
nxagentOptions.ViewportXSpan = 0; nxagentOptions.ViewportXSpan = 0;
nxagentOptions.ViewportYSpan = 0; nxagentOptions.ViewportYSpan = 0;
nxagentOptions.DesktopResize = 1; nxagentOptions.DesktopResize = True;
nxagentOptions.Ratio = DONT_SCALE; nxagentOptions.Ratio = DONT_SCALE;
nxagentOptions.XRatio = DONT_SCALE; nxagentOptions.XRatio = DONT_SCALE;
...@@ -117,25 +119,25 @@ void nxagentInitOptions(void) ...@@ -117,25 +119,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 = False;
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;
...@@ -143,19 +145,19 @@ void nxagentInitOptions(void) ...@@ -143,19 +145,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;
......
...@@ -26,6 +26,12 @@ ...@@ -26,6 +26,12 @@
#ifndef __Options_H__ #ifndef __Options_H__
#define __Options_H__ #define __Options_H__
/* Bool is defined in Xlib.h but we do not want to include that here, so let's
clone the definition */
#ifndef Bool
#define Bool int
#endif
#ifndef True #ifndef True
#define True 1 #define True 1
#endif #endif
...@@ -122,33 +128,33 @@ typedef struct _AgentOptions ...@@ -122,33 +128,33 @@ typedef struct _AgentOptions
/* /*
* Is agent running in desktop mode? This is presently the default. * Is agent running in desktop mode? This is presently the default.
*/ */
int Desktop; Bool Desktop;
/* /*
* True if user activated rootless mode. * True if user activated rootless mode.
*/ */
int Rootless; Bool Rootless;
/* /*
* True for shadow mode. * True for shadow mode.
*/ */
int Shadow; Bool Shadow;
/* /*
* True if user activated persistent mode. * True if user activated persistent mode.
*/ */
int Persistent; Bool Persistent;
/* /*
* True if user activated fullscreen mode. * True if user activated fullscreen mode.
*/ */
int Fullscreen; Bool Fullscreen;
/* /*
* True if the fullscreen NX session will extend on all available * True if the fullscreen NX session will extend on all available
* screens. * screens.
*/ */
int AllScreens; Bool AllScreens;
/* /*
* Set to the auto-disconnect timeout, if the user activated this * Set to the auto-disconnect timeout, if the user activated this
...@@ -176,7 +182,7 @@ typedef struct _AgentOptions ...@@ -176,7 +182,7 @@ typedef struct _AgentOptions
/* /*
* Set if agent is running nested in another agent X server. * Set if agent is running nested in another agent X server.
*/ */
int Nested; Bool Nested;
/* /*
* Selected backing-store mode. * Selected backing-store mode.
...@@ -192,12 +198,12 @@ typedef struct _AgentOptions ...@@ -192,12 +198,12 @@ typedef struct _AgentOptions
* Enable agent to use the MITSHM extension in path from remote * Enable agent to use the MITSHM extension in path from remote
* proxy to the real X server. * proxy to the real X server.
*/ */
int SharedMemory; Bool SharedMemory;
/* /*
* Enable agent to use shared Pixmaps * Enable agent to use shared Pixmaps
*/ */
int SharedPixmaps; Bool SharedPixmaps;
/* /*
* Enable agent to propagate keyboard and pointer device * Enable agent to propagate keyboard and pointer device
...@@ -214,12 +220,12 @@ typedef struct _AgentOptions ...@@ -214,12 +220,12 @@ typedef struct _AgentOptions
* Resuming keyboard device corrects keymap if session migrates * Resuming keyboard device corrects keymap if session migrates
* across platforms with different keycode layout. * across platforms with different keycode layout.
*/ */
int ResetKeyboardAtResume; Bool ResetKeyboardAtResume;
/* /*
* Reset server when the last client disconnects. * Reset server when the last client disconnects.
*/ */
int Reset; Bool Reset;
/* /*
* Geometry of the agent root window, relative to the agent default * Geometry of the agent root window, relative to the agent default
...@@ -236,7 +242,7 @@ typedef struct _AgentOptions ...@@ -236,7 +242,7 @@ typedef struct _AgentOptions
* True if the user can resize the desktop by dragging the window * True if the user can resize the desktop by dragging the window
* border. * border.
*/ */
int DesktopResize; Bool DesktopResize;
/* /*
* The scaling ratio of the shadow agent. * The scaling ratio of the shadow agent.
...@@ -248,19 +254,19 @@ typedef struct _AgentOptions ...@@ -248,19 +254,19 @@ typedef struct _AgentOptions
/* /*
* The shadow agent uses the Damage extension. * The shadow agent uses the Damage extension.
*/ */
int UseDamage; Bool UseDamage;
/* /*
* Was the agent run with the -B option? * Was the agent run with the -B option?
*/ */
int Binder; Bool Binder;
char *BinderOptions; char *BinderOptions;
/* /*
* Set if the agent has to connect to a desktop manager to start the * Set if the agent has to connect to a desktop manager to start the
* session. * session.
*/ */
int Xdmcp; Bool Xdmcp;
/* /*
* Size of the Xlib display buffer. The default is set according to * Size of the Xlib display buffer. The default is set according to
...@@ -276,31 +282,31 @@ typedef struct _AgentOptions ...@@ -276,31 +282,31 @@ typedef struct _AgentOptions
/* /*
* Use the composite extension when available on the remote display. * Use the composite extension when available on the remote display.
*/ */
int Composite; Bool Composite;
/* /*
* If set, don't skip internal operations when the agent window is * If set, don't skip internal operations when the agent window is
* not fully visible. * not fully visible.
*/ */
int IgnoreVisibility; Bool IgnoreVisibility;
/* /*
* If set, prevent the shadow session to interact with master * If set, prevent the shadow session to interact with master
* display. * display.
*/ */
int ViewOnly; Bool ViewOnly;
/* /*
* If true select a lossy or lossless compression method based on * If true select a lossy or lossless compression method based on
* the characteristics of the image. * the characteristics of the image.
*/ */
int Adaptive; Bool Adaptive;
/* /*
* Stream the images and update the display when the image has been * Stream the images and update the display when the image has been
* completely transerred. * completely transerred.
*/ */
int Streaming; Bool Streaming;
/* /*
* Use a lazy approach in updating the remote display. This means * Use a lazy approach in updating the remote display. This means
...@@ -323,12 +329,12 @@ typedef struct _AgentOptions ...@@ -323,12 +329,12 @@ typedef struct _AgentOptions
/* /*
* Enabling/disabling the pulldown menu. * Enabling/disabling the pulldown menu.
*/ */
int Menu; Bool Menu;
/* /*
* Enabling/disabling the magic pixel. * Enabling/disabling the magic pixel.
*/ */
int MagicPixel; Bool MagicPixel;
/* /*
* Specify the Operative System of the client. * Specify the Operative System of the client.
...@@ -338,7 +344,7 @@ typedef struct _AgentOptions ...@@ -338,7 +344,7 @@ typedef struct _AgentOptions
/* /*
* Inhibit some XKEYBOARD requests. * Inhibit some XKEYBOARD requests.
*/ */
int InhibitXkb; Bool InhibitXkb;
/* /*
* Maximum number of bytes that can be pasted from an NX session * Maximum number of bytes that can be pasted from an NX session
...@@ -355,7 +361,7 @@ typedef struct _AgentOptions ...@@ -355,7 +361,7 @@ typedef struct _AgentOptions
* True if agent should not exit if there are no clients in rootless * True if agent should not exit if there are no clients in rootless
* mode * mode
*/ */
int NoRootlessExit; Bool NoRootlessExit;
/* /*
* Store if the user wants Xinerama. There are variables called * Store if the user wants Xinerama. There are variables called
...@@ -365,7 +371,7 @@ typedef struct _AgentOptions ...@@ -365,7 +371,7 @@ typedef struct _AgentOptions
* the user preference provided by the -/+(rr)xinerama parameter(s) * the user preference provided by the -/+(rr)xinerama parameter(s)
* before initializing those extensions. * before initializing those extensions.
*/ */
int Xinerama; Bool Xinerama;
/* /*
* Sleep delay in milliseconds. * Sleep delay in milliseconds.
...@@ -386,7 +392,7 @@ typedef struct _AgentOptions ...@@ -386,7 +392,7 @@ typedef struct _AgentOptions
* True if agent should grab the input in windowed mode whenever the * True if agent should grab the input in windowed mode whenever the
* agent window gets the focus * agent window gets the focus
*/ */
int AutoGrab; /* Should be Bool but I do not want to include Xlib.h here */ Bool AutoGrab;
} AgentOptionsRec; } AgentOptionsRec;
......
...@@ -77,7 +77,7 @@ while (0) ...@@ -77,7 +77,7 @@ while (0)
#define breakOnBlocking(mask) \ #define breakOnBlocking(mask) \
(((mask) != NEVER_BREAK) && ((mask) & BLOCKING_BREAK) && \ (((mask) != NEVER_BREAK) && ((mask) & BLOCKING_BREAK) && \
nxagentBlocking == 1) nxagentBlocking)
#define breakOnCongestion(mask) \ #define breakOnCongestion(mask) \
(((mask) != NEVER_BREAK) && ((mask) & CONGESTION_BREAK) && \ (((mask) != NEVER_BREAK) && ((mask) & CONGESTION_BREAK) && \
...@@ -97,7 +97,7 @@ while (0) ...@@ -97,7 +97,7 @@ while (0)
nxagentUserInput(NULL) == 1) nxagentUserInput(NULL) == 1)
#define canBreakOnTimeout(mask) \ #define canBreakOnTimeout(mask) \
(((mask) != NEVER_BREAK) && nxagentOption(Shadow) == 0) (((mask) != NEVER_BREAK) && !nxagentOption(Shadow))
/* /*
* Macros defining the conditions to * Macros defining the conditions to
...@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE ...@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
(nxagentSplitTrap == 0 && \ (!nxagentSplitTrap && \
nxagentOption(DeferLevel) > 0) nxagentOption(DeferLevel) > 0)
/* /*
...@@ -164,7 +164,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE ...@@ -164,7 +164,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask) \ #define NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask) \
((nxagentCorruptedWindows == 0 && nxagentCorruptedPixmaps > 0 && \ ((nxagentCorruptedWindows == 0 && nxagentCorruptedPixmaps > 0 && \
nxagentCongestion == 0 && nxagentBlocking == 0) || \ nxagentCongestion == 0 && !nxagentBlocking) || \
mask == NEVER_BREAK) mask == NEVER_BREAK)
/* /*
...@@ -173,8 +173,8 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE ...@@ -173,8 +173,8 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
*/ */
#define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \ #define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \
(nxagentWindowIsVisible((WindowPtr) pDrawable) == 1 && \ (nxagentWindowIsVisible((WindowPtr) pDrawable) && \
(nxagentDefaultWindowIsVisible() == 1 || nxagentCompositeEnable == 1)) (nxagentDefaultWindowIsVisible() || nxagentCompositeEnable == 1))
#define MINIMUM_PIXMAP_USAGE_COUNTER 2 #define MINIMUM_PIXMAP_USAGE_COUNTER 2
......
...@@ -200,7 +200,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -200,7 +200,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
* checksum. * checksum.
*/ */
if (width != 0 && height != 0 && nxagentGCTrap == 0) if (width != 0 && height != 0 && !nxagentGCTrap)
{ {
pPixmapPriv -> id = XCreatePixmap(nxagentDisplay, pPixmapPriv -> id = XCreatePixmap(nxagentDisplay,
nxagentDefaultWindows[pScreen -> myNum], nxagentDefaultWindows[pScreen -> myNum],
...@@ -1064,7 +1064,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, ...@@ -1064,7 +1064,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
int wPict, int hPict) int wPict, int hPict)
{ {
if (pDrawable -> type == DRAWABLE_PIXMAP && if (pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentIsShmPixmap((PixmapPtr) pDrawable) == 1) nxagentIsShmPixmap((PixmapPtr) pDrawable))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeShmPixmap: WARNING! Synchronizing shared pixmap at [%p].\n", fprintf(stderr, "nxagentSynchronizeShmPixmap: WARNING! Synchronizing shared pixmap at [%p].\n",
......
...@@ -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__);
......
...@@ -220,7 +220,7 @@ int nxagentHandleConnectionStates(void) ...@@ -220,7 +220,7 @@ int nxagentHandleConnectionStates(void)
} }
} }
if (nxagentNeedConnectionChange() == 1) if (nxagentNeedConnectionChange())
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentHandleConnectionStates: Calling nxagentHandleConnectionChanges " fprintf(stderr, "nxagentHandleConnectionStates: Calling nxagentHandleConnectionChanges "
...@@ -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)
{ {
...@@ -458,7 +458,7 @@ Bool nxagentReconnectSession(void) ...@@ -458,7 +458,7 @@ Bool nxagentReconnectSession(void)
nxagentProcessOptions(nxagentOptionsFilenameOrString); nxagentProcessOptions(nxagentOptionsFilenameOrString);
if (nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]) == 0) if (!nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentReconnectSession: WARNING! Failed display reconnection.\n"); fprintf(stderr, "nxagentReconnectSession: WARNING! Failed display reconnection.\n");
...@@ -468,7 +468,7 @@ Bool nxagentReconnectSession(void) ...@@ -468,7 +468,7 @@ Bool nxagentReconnectSession(void)
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]) == 0) if (!nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]))
{ {
failedStep = SCREEN_STEP; failedStep = SCREEN_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -478,9 +478,9 @@ Bool nxagentReconnectSession(void) ...@@ -478,9 +478,9 @@ Bool nxagentReconnectSession(void)
nxagentListRemoteFonts("*", nxagentMaxFontNames); nxagentListRemoteFonts("*", nxagentMaxFontNames);
if (nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]) == 0) if (!nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]))
{ {
if (nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]) == 0) if (!nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]))
{ {
failedStep = FONT_STEP; failedStep = FONT_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -515,26 +515,26 @@ Bool nxagentReconnectSession(void) ...@@ -515,26 +515,26 @@ Bool nxagentReconnectSession(void)
nxagentEmptyBSPixmapList(); nxagentEmptyBSPixmapList();
/* FIXME: nxagentReconnectAllPixmaps will always return 1 */ /* FIXME: nxagentReconnectAllPixmaps will always return 1 */
if (nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]) == 0) if (!nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]))
{ {
failedStep = PIXMAP_STEP; failedStep = PIXMAP_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]) == 0) if (!nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]))
{ {
failedStep = GC_STEP; failedStep = GC_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]) == 0) if (!nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]))
{ {
failedStep = COLORMAP_STEP; failedStep = COLORMAP_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]) == 0) if (!nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]))
{ {
failedStep = WINDOW_STEP; failedStep = WINDOW_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -542,32 +542,32 @@ Bool nxagentReconnectSession(void) ...@@ -542,32 +542,32 @@ Bool nxagentReconnectSession(void)
if (nxagentRenderEnable) if (nxagentRenderEnable)
{ {
if (nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]) == 0) if (!nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]))
{ {
failedStep = GLYPHSET_STEP; failedStep = GLYPHSET_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]) == 0) if (!nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]))
{ {
failedStep = PICTFORMAT_STEP; failedStep = PICTFORMAT_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]) == 0) if (!nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]))
{ {
failedStep = PICTURE_STEP; failedStep = PICTURE_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
} }
if (nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]) == 0) if (!nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]))
{ {
failedStep = CURSOR_STEP; failedStep = CURSOR_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]) == 0) if (!nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]))
{ {
failedStep = WINDOW_STEP; failedStep = WINDOW_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -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 ||
...@@ -598,7 +598,7 @@ Bool nxagentReconnectSession(void) ...@@ -598,7 +598,7 @@ Bool nxagentReconnectSession(void)
if (nxagentResetKeyboard() == 0) if (nxagentResetKeyboard() == 0)
{ {
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__); fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__);
} }
...@@ -616,7 +616,7 @@ Bool nxagentReconnectSession(void) ...@@ -616,7 +616,7 @@ Bool nxagentReconnectSession(void)
} }
} }
nxagentXkbState.Initialized = 0; nxagentXkbState.Initialized = False;
SAFE_free(nxagentOldKeyboard); SAFE_free(nxagentOldKeyboard);
...@@ -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) || nxagentOption(Xinerama))
{ {
nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True); nxagentOption(RootHeight), True);
...@@ -699,7 +699,7 @@ nxagentReconnectError: ...@@ -699,7 +699,7 @@ nxagentReconnectError:
if (*nxagentGetReconnectError() == '\0') if (*nxagentGetReconnectError() == '\0')
{ {
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "nxagentReconnectSession: WARNING! The reconnect error message is not set. Failed step is [%d].\n", fprintf(stderr, "nxagentReconnectSession: WARNING! The reconnect error message is not set. Failed step is [%d].\n",
failedStep); failedStep);
......
...@@ -925,7 +925,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -925,7 +925,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPRepeat) if (mask & CPRepeat)
{ {
attributes.repeat = (Bool)pPicture -> repeat; attributes.repeat = (Bool)pPicture -> repeat;
if (nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat))
{ {
valuemask |= CPRepeat; valuemask |= CPRepeat;
nxagentSetPictureRemoteValue(pPicture, repeat, attributes.repeat); nxagentSetPictureRemoteValue(pPicture, repeat, attributes.repeat);
...@@ -935,7 +935,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -935,7 +935,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaMap) if (mask & CPAlphaMap)
{ {
attributes.alpha_map = nxagentPicturePriv(pPicture -> alphaMap) -> picture; attributes.alpha_map = nxagentPicturePriv(pPicture -> alphaMap) -> picture;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map))
{ {
valuemask |= CPAlphaMap; valuemask |= CPAlphaMap;
nxagentSetPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map); nxagentSetPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map);
...@@ -945,7 +945,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -945,7 +945,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaXOrigin) if (mask & CPAlphaXOrigin)
{ {
attributes.alpha_x_origin = pPicture -> alphaOrigin.x; attributes.alpha_x_origin = pPicture -> alphaOrigin.x;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin))
{ {
valuemask |= CPAlphaXOrigin; valuemask |= CPAlphaXOrigin;
nxagentSetPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin); nxagentSetPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin);
...@@ -955,7 +955,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -955,7 +955,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaYOrigin) if (mask & CPAlphaYOrigin)
{ {
attributes.alpha_y_origin = pPicture -> alphaOrigin.y; attributes.alpha_y_origin = pPicture -> alphaOrigin.y;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin))
{ {
valuemask |= CPAlphaYOrigin; valuemask |= CPAlphaYOrigin;
nxagentSetPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin); nxagentSetPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin);
...@@ -965,7 +965,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -965,7 +965,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPClipXOrigin) if (mask & CPClipXOrigin)
{ {
attributes.clip_x_origin = pPicture -> clipOrigin.x; attributes.clip_x_origin = pPicture -> clipOrigin.x;
if (nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin))
{ {
valuemask |= CPClipXOrigin; valuemask |= CPClipXOrigin;
nxagentSetPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin); nxagentSetPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin);
...@@ -975,7 +975,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -975,7 +975,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPClipYOrigin) if (mask & CPClipYOrigin)
{ {
attributes.clip_y_origin = pPicture -> clipOrigin.y; attributes.clip_y_origin = pPicture -> clipOrigin.y;
if (nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin))
{ {
valuemask |= CPClipYOrigin; valuemask |= CPClipYOrigin;
nxagentSetPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin); nxagentSetPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin);
...@@ -985,7 +985,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -985,7 +985,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPGraphicsExposure) if (mask & CPGraphicsExposure)
{ {
attributes.graphics_exposures = (Bool)pPicture -> graphicsExposures; attributes.graphics_exposures = (Bool)pPicture -> graphicsExposures;
if (nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures))
{ {
valuemask |= CPGraphicsExposure; valuemask |= CPGraphicsExposure;
nxagentSetPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures); nxagentSetPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures);
...@@ -995,7 +995,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -995,7 +995,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPSubwindowMode) if (mask & CPSubwindowMode)
{ {
attributes.subwindow_mode = pPicture -> subWindowMode; attributes.subwindow_mode = pPicture -> subWindowMode;
if (nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode))
{ {
valuemask |= CPSubwindowMode; valuemask |= CPSubwindowMode;
nxagentSetPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode); nxagentSetPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode);
...@@ -1021,7 +1021,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1021,7 +1021,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPPolyEdge) if (mask & CPPolyEdge)
{ {
attributes.poly_edge = pPicture -> polyEdge; attributes.poly_edge = pPicture -> polyEdge;
if (nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge))
{ {
valuemask |= CPPolyEdge; valuemask |= CPPolyEdge;
nxagentSetPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge); nxagentSetPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge);
...@@ -1031,7 +1031,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1031,7 +1031,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPPolyMode) if (mask & CPPolyMode)
{ {
attributes.poly_mode = pPicture -> polyMode; attributes.poly_mode = pPicture -> polyMode;
if (nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode))
{ {
valuemask |= CPPolyMode; valuemask |= CPPolyMode;
nxagentSetPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode); nxagentSetPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode);
...@@ -1041,7 +1041,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1041,7 +1041,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPDither) if (mask & CPDither)
{ {
attributes.dither = pPicture -> dither; attributes.dither = pPicture -> dither;
if (nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither))
{ {
valuemask |= CPDither; valuemask |= CPDither;
nxagentSetPictureRemoteValue(pPicture, dither, attributes.dither); nxagentSetPictureRemoteValue(pPicture, dither, attributes.dither);
...@@ -1051,7 +1051,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1051,7 +1051,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPComponentAlpha) if (mask & CPComponentAlpha)
{ {
attributes.component_alpha = pPicture -> componentAlpha; attributes.component_alpha = pPicture -> componentAlpha;
if (nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha))
{ {
valuemask |= CPComponentAlpha; valuemask |= CPComponentAlpha;
nxagentSetPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha); nxagentSetPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha);
...@@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1, RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1,
glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1); glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1);
if (RegionNil(pRegion) == 1) if (RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n", fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n",
...@@ -2252,7 +2252,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2) ...@@ -2252,7 +2252,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2)
{ {
GlyphSetPtr pGly = (GlyphSetPtr) p0; GlyphSetPtr pGly = (GlyphSetPtr) p0;
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
int i; int i;
XRenderPictFormat *pForm = NULL; XRenderPictFormat *pForm = NULL;
......
...@@ -176,7 +176,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix); ...@@ -176,7 +176,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix);
* These variables are for shadowing feature. * These variables are for shadowing feature.
*/ */
int nxagentShadowResize = 0; Bool nxagentShadowResize = False;
WindowPtr nxagentShadowWindowPtr = NULL; WindowPtr nxagentShadowWindowPtr = NULL;
...@@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix) ...@@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix)
fprintf(stderr, "%s | Fullscreen is %s.\n", prefix, fprintf(stderr, "%s | Fullscreen is %s.\n", prefix,
nxagentOption(Fullscreen) ? "ON" : "OFF"); nxagentOption(Fullscreen) ? "ON" : "OFF");
fprintf(stderr, "%s | AllScreens is %s.\n", prefix,
nxagentOption(AllScreens) ? "ON" : "OFF");
fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix, fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix,
nxagentOption(DesktopResize) ? "ON" : "OFF"); nxagentOption(DesktopResize) ? "ON" : "OFF");
...@@ -846,7 +849,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -846,7 +849,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
pScreen->myNum); pScreen->myNum);
#endif #endif
if (nxagentRenderEnable && nxagentReconnectTrap == False) if (nxagentRenderEnable && !nxagentReconnectTrap)
{ {
PictureScreenPrivateIndex = -1; PictureScreenPrivateIndex = -1;
} }
...@@ -901,7 +904,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -901,7 +904,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* user geometry then. * user geometry then.
*/ */
if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) if (!nxagentReconnectTrap && !nxagentOption(Rootless))
{ {
if (nxagentUserGeometry.flag & XValue) if (nxagentUserGeometry.flag & XValue)
{ {
...@@ -945,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -945,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* the screen if we are either in rootless or in fullscreen mode. * the screen if we are either in rootless or in fullscreen mode.
*/ */
if (nxagentOption(Rootless) == False && !nxagentWMIsRunning) if (!nxagentOption(Rootless) && !nxagentWMIsRunning)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n"); fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n");
...@@ -954,7 +957,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -954,7 +957,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(Fullscreen, True); nxagentChangeOption(Fullscreen, True);
if (nxagentOption(ClientOs) == ClientOsWinnt && if (nxagentOption(ClientOs) == ClientOsWinnt &&
(nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup))
{ {
NXSetExposeParameters(nxagentDisplay, 0, 0, 0); NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
} }
...@@ -963,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -963,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
if (nxagentOption(Fullscreen) && if (nxagentOption(Fullscreen) &&
nxagentWMIsRunning && nxagentWMIsRunning &&
nxagentReconnectTrap && nxagentReconnectTrap &&
nxagentResizeDesktopAtStartup == False && !nxagentResizeDesktopAtStartup &&
nxagentXServerGeometryChanged()) nxagentXServerGeometryChanged())
{ {
#ifdef TEST #ifdef TEST
...@@ -993,7 +996,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -993,7 +996,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(Height, h); nxagentChangeOption(Height, h);
/* first time screen initialization or resize during reconnect */ /* first time screen initialization or resize during reconnect */
if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)
{ {
if (nxagentOption(RootWidth) >= w) if (nxagentOption(RootWidth) >= w)
{ {
...@@ -1046,7 +1049,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -1046,7 +1049,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* screen is initialized for the first time. * screen is initialized for the first time.
*/ */
if (nxagentReconnectTrap == False) if (!nxagentReconnectTrap)
{ {
nxagentChangeOption(RootX, 0); nxagentChangeOption(RootX, 0);
nxagentChangeOption(RootY, 0); nxagentChangeOption(RootY, 0);
...@@ -1085,7 +1088,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -1085,7 +1088,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* the root window isn't bigger than the X server root window.. * the root window isn't bigger than the X server root window..
*/ */
if (nxagentReconnectTrap == False) if (!nxagentReconnectTrap)
{ {
if ((nxagentOption(RootWidth) < w) && if ((nxagentOption(RootWidth) < w) &&
!(nxagentUserGeometry.flag & WidthValue)) !(nxagentUserGeometry.flag & WidthValue))
...@@ -1117,7 +1120,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -1117,7 +1120,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth));
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight));
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
if (nxagentOption(Persistent)) if (nxagentOption(Persistent))
{ {
...@@ -1654,8 +1657,8 @@ N/A ...@@ -1654,8 +1657,8 @@ N/A
nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:"); nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:");
#endif #endif
if (nxagentDoFullGeneration == 1 || if (nxagentDoFullGeneration ||
nxagentReconnectTrap == 1) nxagentReconnectTrap)
{ {
unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap; unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap;
XSetWindowAttributes attributes = { XSetWindowAttributes attributes = {
...@@ -1664,13 +1667,13 @@ N/A ...@@ -1664,13 +1667,13 @@ N/A
.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)) .colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen))
}; };
if (nxagentOption(AllScreens) == 1) if (nxagentOption(AllScreens))
{ {
valuemask |= CWOverrideRedirect; valuemask |= CWOverrideRedirect;
attributes.override_redirect = True; attributes.override_redirect = True;
} }
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
if (nxagentReconnectTrap) if (nxagentReconnectTrap)
{ {
...@@ -1729,7 +1732,7 @@ N/A ...@@ -1729,7 +1732,7 @@ N/A
pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]); pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask}; XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask};
...@@ -1833,7 +1836,7 @@ N/A ...@@ -1833,7 +1836,7 @@ N/A
sizeHints->width = nxagentOption(RootWidth); sizeHints->width = nxagentOption(RootWidth);
sizeHints->height = nxagentOption(RootHeight); sizeHints->height = nxagentOption(RootHeight);
if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen))
{ {
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
...@@ -1950,7 +1953,7 @@ N/A ...@@ -1950,7 +1953,7 @@ N/A
/* FIXME: This doing the same thing in both cases. The /* FIXME: This doing the same thing in both cases. The
comments do not seem accurate (anymore?) */ comments do not seem accurate (anymore?) */
if (nxagentOption(Rootless) == False) if (!nxagentOption(Rootless))
{ {
/* /*
* Set the WM_DELETE_WINDOW protocol for the main agent * Set the WM_DELETE_WINDOW protocol for the main agent
...@@ -1998,7 +2001,7 @@ N/A ...@@ -1998,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");
} }
...@@ -2362,7 +2365,7 @@ FIXME: We should try to restore the previously ...@@ -2362,7 +2365,7 @@ FIXME: We should try to restore the previously
* Change agent window size and size hints. * Change agent window size and size hints.
*/ */
if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)) if (!(nxagentOption(Fullscreen) || nxagentOption(AllScreens)))
{ {
nxagentSetWMNormalHints(pScreen->myNum, width, height); nxagentSetWMNormalHints(pScreen->myNum, width, height);
...@@ -2374,7 +2377,7 @@ FIXME: We should try to restore the previously ...@@ -2374,7 +2377,7 @@ FIXME: We should try to restore the previously
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
} }
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height); fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height);
...@@ -2529,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2529,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
NXShadowSetDisplayUid(nxagentShadowUid); NXShadowSetDisplayUid(nxagentShadowUid);
} }
if (nxagentOption(UseDamage) == 0) if (nxagentOption(UseDamage))
{ {
NXShadowDisableDamage(); NXShadowDisableDamage();
} }
...@@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
return -1; return -1;
} }
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth,
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight);
...@@ -2900,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended) ...@@ -2900,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended)
{ {
*suspended = 0; *suspended = 0;
if (RegionNil(&nxagentShadowUpdateRegion) == 1) if (RegionNil(&nxagentShadowUpdateRegion))
{ {
return 0; return 0;
} }
...@@ -4396,7 +4399,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height) ...@@ -4396,7 +4399,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
sizeHints->width = width; sizeHints->width = width;
sizeHints->height = height; sizeHints->height = height;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
......
...@@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion; ...@@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion;
extern WindowPtr nxagentShadowWindowPtr; extern WindowPtr nxagentShadowWindowPtr;
extern int nxagentShadowResize; extern Bool nxagentShadowResize;
extern short nxagentShadowUid; extern short nxagentShadowUid;
......
...@@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
RegionIntersect(&tmpRegion, pResource -> region, pRegion); RegionIntersect(&tmpRegion, pResource -> region, pRegion);
if (RegionNil(&tmpRegion) == 0) if (!RegionNil(&tmpRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid " fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid "
...@@ -829,11 +829,11 @@ static Bool nxagentWaitSplitPredicate(Display *disp, XEvent *event, XPointer ptr ...@@ -829,11 +829,11 @@ static Bool nxagentWaitSplitPredicate(Display *disp, XEvent *event, XPointer ptr
event -> xclient.format == 32); event -> xclient.format == 32);
} }
int nxagentWaitSplitEvent(int resource) Bool nxagentWaitSplitEvent(int resource)
{ {
XEvent event; XEvent event;
int split = 0; Bool split = 0;
/* /*
* Don't flush the link. We only want to query the NX transport to * Don't flush the link. We only want to query the NX transport to
...@@ -890,7 +890,7 @@ int nxagentWaitSplitEvent(int resource) ...@@ -890,7 +890,7 @@ int nxagentWaitSplitEvent(int resource)
{ {
nxagentHandleStartSplitEvent(resource); nxagentHandleStartSplitEvent(resource);
split = 1; split = True;
break; break;
} }
...@@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource) ...@@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource)
if (pResource -> drawable != NULL && if (pResource -> drawable != NULL &&
pResource -> region != NullRegion) pResource -> region != NullRegion)
{ {
if (RegionNil(pResource -> region) == 0) if (!RegionNil(pResource -> region))
{ {
RegionSubtract( RegionSubtract(
nxagentCorruptedRegion(pResource -> drawable), nxagentCorruptedRegion(pResource -> drawable),
......
...@@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) ...@@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin) -> corruptedTimestamp = 0; nxagentWindowPriv(pWin) -> corruptedTimestamp = 0;
nxagentWindowPriv(pWin) -> splitResource = NULL; nxagentWindowPriv(pWin) -> splitResource = NULL;
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
nxagentWindowPriv(pWin) -> isMapped = 0; nxagentWindowPriv(pWin) -> isMapped = 0;
...@@ -548,7 +548,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -548,7 +548,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
{ {
nxagentPrivWindowPtr pWindowPriv; nxagentPrivWindowPtr pWindowPriv;
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return 1; return 1;
} }
...@@ -643,7 +643,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -643,7 +643,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
} }
if (nxagentOption(Rootless) && nxagentRootlessDialogPid == 0 && if (nxagentOption(Rootless) && nxagentRootlessDialogPid == 0 &&
nxagentLastWindowDestroyed == False && nxagentSomeWindowsAreMapped() == False) !nxagentLastWindowDestroyed && nxagentSomeWindowsAreMapped() == False)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDestroyWindow: Last mapped window as been destroyed.\n"); fprintf(stderr, "nxagentDestroyWindow: Last mapped window as been destroyed.\n");
...@@ -672,7 +672,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -672,7 +672,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
*/ */
Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return True; return True;
} }
...@@ -690,7 +690,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) ...@@ -690,7 +690,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return; return;
} }
...@@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) ...@@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{ {
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
return; return;
} }
...@@ -901,9 +901,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -901,9 +901,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w; nxagentFullscreenWindow = w;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True);
...@@ -952,12 +952,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -952,12 +952,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentIconWindow = nxagentFullscreenWindow = None; nxagentIconWindow = nxagentFullscreenWindow = None;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True); nxagentOption(RootHeight), True);
...@@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight)); nxagentChangeOption(Height, nxagentOption(SavedHeight));
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1) if (nxagentOption(Shadow) && nxagentOption(DesktopResize))
{ {
nxagentShadowAdaptToRatio(); nxagentShadowAdaptToRatio();
} }
...@@ -1250,7 +1250,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1250,7 +1250,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x; int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x;
int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y; int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y;
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n"); fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n");
...@@ -1259,8 +1259,8 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1259,8 +1259,8 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
return; return;
} }
if (nxagentOption(Rootless) == 1 && if (nxagentOption(Rootless) &&
nxagentWindowTopLevel(pWin) == 1) nxagentWindowTopLevel(pWin))
{ {
mask &= ~(CWSibling | CWStackMode); mask &= ~(CWSibling | CWStackMode);
} }
...@@ -1877,7 +1877,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired) ...@@ -1877,7 +1877,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
-+ */ -+ */
Bool nxagentRealizeWindow(WindowPtr pWin) Bool nxagentRealizeWindow(WindowPtr pWin)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return True; return True;
} }
...@@ -2146,7 +2146,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo ...@@ -2146,7 +2146,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
if (nxagentSessionState != SESSION_DOWN) if (nxagentSessionState != SESSION_DOWN)
{ {
if (nxagentExposeArrayIsInitialized == 0) if (!nxagentExposeArrayIsInitialized)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentWindowExposures: Initializing expose queue.\n"); fprintf(stderr, "nxagentWindowExposures: Initializing expose queue.\n");
...@@ -2171,7 +2171,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo ...@@ -2171,7 +2171,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
nxagentInitRemoteExposeRegion(); nxagentInitRemoteExposeRegion();
nxagentExposeArrayIsInitialized = 1; nxagentExposeArrayIsInitialized = True;
} }
RegionRec temp; RegionRec temp;
...@@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo ...@@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
RegionUnion(&temp, &temp, other_exposed); RegionUnion(&temp, &temp, other_exposed);
} }
if (RegionNil(&temp) == 0) if (!RegionNil(&temp))
{ {
RegionTranslate(&temp, RegionTranslate(&temp,
-(pWin -> drawable.x), -(pWin -> drawable.y)); -(pWin -> drawable.x), -(pWin -> drawable.y));
...@@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin) ...@@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin)
void nxagentUnmapWindows(void) void nxagentUnmapWindows(void)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
for (int i = 0; i < screenInfo.numScreens; i++) for (int i = 0; i < screenInfo.numScreens; i++)
{ {
...@@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void)
*/ */
MapWindow(pWin, serverClient); MapWindow(pWin, serverClient);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
/* /*
* Show the NX splash screen. * Show the NX splash screen.
...@@ -2547,7 +2547,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2547,7 +2547,7 @@ void nxagentMapDefaultWindows(void)
* Windows client. * Windows client.
*/ */
if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning) if (!nxagentOption(Shadow) || !nxagentWMIsRunning)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n", fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
...@@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning) if (nxagentOption(Fullscreen) && nxagentWMIsRunning)
{ {
nxagentMaximizeToFullScreen(pScreen); nxagentMaximizeToFullScreen(pScreen);
} }
...@@ -2573,7 +2573,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2573,7 +2573,7 @@ void nxagentMapDefaultWindows(void)
* nxagentReconnectAllWindows, after the Root Window is mapped. * nxagentReconnectAllWindows, after the Root Window is mapped.
*/ */
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]); XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]);
} }
...@@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0) ...@@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0)
* raised. * raised.
*/ */
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
for (int i = 0; i < screenInfo.numScreens; i++) for (int i = 0; i < screenInfo.numScreens; i++)
{ {
...@@ -3274,7 +3274,7 @@ XXX: This would break Motif menus. ...@@ -3274,7 +3274,7 @@ XXX: This would break Motif menus.
XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum); XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum);
} }
} }
else if (nxagentOption(Rootless) == 0) else if (!nxagentOption(Rootless))
{ {
/* /*
* Map the root window. * Map the root window.
......
...@@ -36,6 +36,6 @@ ...@@ -36,6 +36,6 @@
extern xdmcp_states XdmcpState; extern xdmcp_states XdmcpState;
extern int XdmcpTimeOutRtx; extern int XdmcpTimeOutRtx;
extern int XdmcpStartTime; extern int XdmcpStartTime;
extern int nxagentXdmcpUp; extern Bool nxagentXdmcpUp;
#endif /* __Xdmcp_H__ */ #endif /* __Xdmcp_H__ */
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