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) ...@@ -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);
...@@ -830,7 +830,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -830,7 +830,7 @@ 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, False); nxagentChangeOption(Persistent, False);
return 1; return 1;
...@@ -1749,7 +1749,7 @@ N/A ...@@ -1749,7 +1749,7 @@ N/A
#endif #endif
if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen)) if ((nxagentOption(Rootless) == True) && 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");
...@@ -2029,7 +2029,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. ...@@ -2029,7 +2029,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) == True) && nxagentOption(Xdmcp))
{ {
FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n");
} }
...@@ -2353,7 +2353,7 @@ void nxagentSetDeferLevel(void) ...@@ -2353,7 +2353,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");
...@@ -2368,7 +2368,7 @@ void nxagentSetDeferLevel(void) ...@@ -2368,7 +2368,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");
...@@ -2472,7 +2472,7 @@ void nxagentSetScheduler(void) ...@@ -2472,7 +2472,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");
......
...@@ -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))
{ {
...@@ -852,7 +852,7 @@ nxagentSynchronizeRegionStop: ...@@ -852,7 +852,7 @@ nxagentSynchronizeRegionStop:
success = 1; success = 1;
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
if (nxagentSynchronization.abort == 1) if (nxagentSynchronization.abort == 1)
{ {
...@@ -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))
{ {
......
...@@ -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) && 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);
...@@ -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;
} }
...@@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X) ...@@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentChangeOption(Y, newY); nxagentChangeOption(Y, newY);
} }
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) && 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))
{ {
...@@ -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) &&
...@@ -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;
} }
......
...@@ -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)
......
...@@ -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));
} }
......
...@@ -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();
} }
......
...@@ -62,6 +62,7 @@ void nxagentInitOptions(void) ...@@ -62,6 +62,7 @@ void nxagentInitOptions(void)
nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Desktop = UNDEFINED;
nxagentOptions.Persistent = True; nxagentOptions.Persistent = True;
nxagentOptions.Rootless = UNDEFINED; nxagentOptions.Rootless = UNDEFINED;
nxagentOptions.Shadow = False;
nxagentOptions.Fullscreen = False; nxagentOptions.Fullscreen = False;
nxagentOptions.AllScreens = False; nxagentOptions.AllScreens = False;
nxagentOptions.NoRootlessExit = False; nxagentOptions.NoRootlessExit = False;
......
...@@ -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
......
...@@ -903,7 +903,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -903,7 +903,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
if (nxagentOption(DesktopResize)) 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);
...@@ -957,7 +957,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -957,7 +957,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
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)) if (nxagentOption(Shadow) && nxagentOption(DesktopResize))
{ {
nxagentShadowAdaptToRatio(); nxagentShadowAdaptToRatio();
} }
...@@ -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",
......
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