Commit acb861df authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: make nxagentOption Shadow a Boolean

and add the missing init code.
parent 2565484f
......@@ -507,7 +507,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
sscanf(argv[i], "%i", &level) == 1 &&
level >= 0 && level <= 2)
{
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
nxagentChangeOption(DeferLevel, level);
......@@ -830,7 +830,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-S"))
{
nxagentChangeOption(Shadow, 1);
nxagentChangeOption(Shadow, True);
nxagentChangeOption(DeferLevel, 0);
nxagentChangeOption(Persistent, False);
return 1;
......@@ -1749,7 +1749,7 @@ N/A
#endif
if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen))
if ((nxagentOption(Rootless) == True) && nxagentOption(Fullscreen))
{
#ifdef TEST
fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n");
......@@ -2029,7 +2029,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
nxagentAlphaEnabled = False;
}
if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp))
if ((nxagentOption(Rootless) == True) && nxagentOption(Xdmcp))
{
FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n");
}
......@@ -2353,7 +2353,7 @@ void nxagentSetDeferLevel(void)
* Set the defer timeout.
*/
if (nxagentOption(Shadow) == 1)
if (nxagentOption(Shadow))
{
#ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n");
......@@ -2368,7 +2368,7 @@ void nxagentSetDeferLevel(void)
* Set the defer level.
*/
if (nxagentOption(Shadow) == 1)
if (nxagentOption(Shadow))
{
#ifdef TEST
fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n");
......@@ -2472,7 +2472,7 @@ void nxagentSetScheduler(void)
* The smart scheduler is the default.
*/
if (nxagentOption(Shadow) == 1)
if (nxagentOption(Shadow))
{
#ifdef TEST
fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n");
......
......@@ -799,7 +799,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (owner != NULL)
{
if (nxagentOption(Shadow) == 1 &&
if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE))
{
......@@ -852,7 +852,7 @@ nxagentSynchronizeRegionStop:
success = 1;
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
if (nxagentSynchronization.abort == 1)
{
......@@ -921,7 +921,7 @@ nxagentSynchronizeRegionStop:
int w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1;
int h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1;
if (nxagentOption(Shadow) == 1 &&
if (nxagentOption(Shadow) &&
(nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE))
{
......
......@@ -1043,7 +1043,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
}
case doSwitchResizeMode:
{
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
if (nxagentNoDialogIsRunning)
{
......@@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentRemoveDuplicatedKeys(&X);
}
if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) == 1 && result == doNothing)
if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && result == doNothing)
{
X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode);
......@@ -1492,7 +1492,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
NXShadowEvent(nxagentDisplay, X);
}
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
nxagentInputEvent = 1;
}
......@@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentChangeOption(Y, newY);
}
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) &&
if (nxagentOption(Shadow) && nxagentOption(DesktopResize) &&
(nxagentOption(Width) != X -> xconfigure.width ||
nxagentOption(Height) != X -> xconfigure.height))
{
......@@ -3397,7 +3397,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
/* if in shadowing mode or if neither size nor position have
changed we do not need to adjust RandR */
/* FIXME: Comment makes no sense */
if (nxagentOption(Shadow) == 1 ||
if (nxagentOption(Shadow) ||
(nxagentOption(Width) == nxagentOption(RootWidth) &&
nxagentOption(Height) == nxagentOption(RootHeight) &&
nxagentOption(X) == nxagentOption(RootX) &&
......@@ -4323,7 +4323,7 @@ int nxagentUserInput(void *p)
* eventually change the nxagentInputEvent status.
*/
if (nxagentOption(Shadow) == 1 &&
if (nxagentOption(Shadow) &&
nxagentPendingEvents(nxagentDisplay) > 0)
{
nxagentDispatchEvents(NULL);
......@@ -4342,7 +4342,7 @@ int nxagentUserInput(void *p)
* browser's page), in order to update the screen smoothly.
*/
if (nxagentOption(Shadow) == 1)
if (nxagentOption(Shadow))
{
return result;
}
......
......@@ -925,7 +925,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
int bytesPerLine = nxagentImagePad(w, format, leftPad, depth);
if (nxagentOption(Shadow) == 1 && format == ZPixmap &&
if (nxagentOption(Shadow) && format == ZPixmap &&
(nxagentOption(XRatio) != DONT_SCALE ||
nxagentOption(YRatio) != DONT_SCALE) &&
pDrawable == (DrawablePtr) nxagentShadowPixmapPtr)
......
......@@ -776,7 +776,7 @@ XkbError:
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
}
if (nxagentOption(Shadow) == 1 && pDev && pDev->key)
if (nxagentOption(Shadow) && pDev && pDev->key)
{
NXShadowInitKeymap(&(pDev->key->curKeySyms));
}
......
......@@ -575,7 +575,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString());
}
if (nxagentOption(Shadow) == 1)
if (nxagentOption(Shadow))
{
NXShadowDestroy();
}
......
......@@ -62,6 +62,7 @@ void nxagentInitOptions(void)
nxagentOptions.Desktop = UNDEFINED;
nxagentOptions.Persistent = True;
nxagentOptions.Rootless = UNDEFINED;
nxagentOptions.Shadow = False;
nxagentOptions.Fullscreen = False;
nxagentOptions.AllScreens = False;
nxagentOptions.NoRootlessExit = False;
......
......@@ -97,7 +97,7 @@ while (0)
nxagentUserInput(NULL) == 1)
#define canBreakOnTimeout(mask) \
(((mask) != NEVER_BREAK) && nxagentOption(Shadow) == 0)
(((mask) != NEVER_BREAK) && !nxagentOption(Shadow))
/*
* Macros defining the conditions to
......
......@@ -903,7 +903,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
if (nxagentOption(DesktopResize))
{
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True);
......@@ -957,7 +957,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True);
......@@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight));
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize))
if (nxagentOption(Shadow) && nxagentOption(DesktopResize))
{
nxagentShadowAdaptToRatio();
}
......@@ -2547,7 +2547,7 @@ void nxagentMapDefaultWindows(void)
* Windows client.
*/
if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning)
if (!nxagentOption(Shadow) || !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
......
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