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

nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as Booleans

The already where Booleans but where not using True/False values everywhere
parent 6e9b3a7f
......@@ -1220,13 +1220,13 @@ static void nxagentParseSingleOption(char *name, char *value)
}
else if (!strcmp(name, "resize"))
{
if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0)
if (!nxagentOption(DesktopResize) || strcmp(value, "0") == 0)
{
nxagentResizeDesktopAtStartup = 0;
nxagentResizeDesktopAtStartup = False;
}
else if (strcmp(value, "1") == 0)
{
nxagentResizeDesktopAtStartup = 1;
nxagentResizeDesktopAtStartup = True;
}
else
{
......
......@@ -569,7 +569,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentChangeOption(DesktopResize, !desktopResize);
if (nxagentOption(DesktopResize) == 0)
if (!nxagentOption(DesktopResize))
{
fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n");
......@@ -607,7 +607,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
nxagentChangeOption(DesktopResize, !desktopResize);
if (nxagentOption(DesktopResize) == 0)
if (!nxagentOption(DesktopResize))
{
nxagentShadowSetRatio(1.0, 1.0);
......@@ -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))
{
/*
......@@ -3303,7 +3303,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
int newX = X -> xconfigure.x;
int newY = X -> xconfigure.y;
if (nxagentOption(DesktopResize) == 1)
if (nxagentOption(DesktopResize))
{
if (nxagentOption(Width) != X -> xconfigure.width ||
nxagentOption(Height) != X -> xconfigure.height ||
......@@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentChangeOption(Y, newY);
}
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 &&
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) &&
(nxagentOption(Width) != X -> xconfigure.width ||
nxagentOption(Height) != X -> xconfigure.height))
{
......
......@@ -429,7 +429,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
{
UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 &&
if (nxagentOption(DesktopResize) &&
(nxagentOption(Fullscreen) ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
......@@ -437,11 +437,11 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
if (nxagentOption(ClientOs) != ClientOsWinnt
/*&& nxagentOption(ClientOs) != ClientNXPlayer*/)
{
nxagentChangeOption(DesktopResize, 0);
nxagentChangeOption(DesktopResize, False);
}
}
if (nxagentOption(DesktopResize) == 1 && !nxagentOption(Fullscreen) &&
if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) &&
!nxagentOption(AllScreens))
{
nxagentChangeOption(Width, width);
......@@ -450,7 +450,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True);
if (result == 1 && nxagentOption(DesktopResize) == 1 &&
if (result == 1 && nxagentOption(DesktopResize) &&
!nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{
nxagentRandRSetWindowsSize(width, height);
......
......@@ -108,7 +108,7 @@ void nxagentInitOptions(void)
nxagentOptions.ViewportXSpan = 0;
nxagentOptions.ViewportYSpan = 0;
nxagentOptions.DesktopResize = 1;
nxagentOptions.DesktopResize = True;
nxagentOptions.Ratio = DONT_SCALE;
nxagentOptions.XRatio = DONT_SCALE;
......
......@@ -966,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
if (nxagentOption(Fullscreen) &&
nxagentWMIsRunning &&
nxagentReconnectTrap &&
nxagentResizeDesktopAtStartup == False &&
!nxagentResizeDesktopAtStartup &&
nxagentXServerGeometryChanged())
{
#ifdef TEST
......@@ -1836,7 +1836,7 @@ N/A
sizeHints->width = nxagentOption(RootWidth);
sizeHints->height = nxagentOption(RootHeight);
if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen))
if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen))
{
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
......@@ -4399,7 +4399,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
sizeHints->width = width;
sizeHints->height = height;
if (nxagentOption(DesktopResize) == 1)
if (nxagentOption(DesktopResize))
{
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
......
......@@ -901,7 +901,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w;
if (nxagentOption(DesktopResize) == 1)
if (nxagentOption(DesktopResize))
{
if (nxagentOption(Shadow) == 0)
{
......@@ -952,7 +952,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentIconWindow = nxagentFullscreenWindow = None;
if (nxagentOption(DesktopResize) == 1)
if (nxagentOption(DesktopResize))
{
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
......@@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight));
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1)
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize))
{
nxagentShadowAdaptToRatio();
}
......
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