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

nxagent: make Desktop, Rootless and Binder options Booleans (again)

They have been changed to tri-state variables (1, 0 and UNDEFINED) between nxagent 1.5.0-90 and -93, for no obvious reason.
parent 7b299a4c
......@@ -801,14 +801,9 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-R"))
{
if (nxagentOption(Binder) == UNDEFINED ||
nxagentOption(Desktop) == UNDEFINED ||
nxagentOption(Rootless) == UNDEFINED)
{
nxagentChangeOption(Binder, False);
nxagentChangeOption(Desktop, False);
nxagentChangeOption(Rootless, True);
}
nxagentChangeOption(Binder, False);
nxagentChangeOption(Desktop, False);
nxagentChangeOption(Rootless, True);
return 1;
}
......@@ -1749,13 +1744,14 @@ N/A
#endif
if ((nxagentOption(Rootless) == True) && nxagentOption(Fullscreen))
if (nxagentOption(Rootless) && nxagentOption(Fullscreen))
{
#ifdef TEST
fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n");
#endif
nxagentChangeOption(Fullscreen, False);
nxagentChangeOption(AllScreens, False);
}
/*
......@@ -1971,25 +1967,6 @@ N/A
nxagentSetCoalescence();
/*
* Set the other defaults.
*/
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
* in window.c in the dix.
*/
......@@ -2029,7 +2006,7 @@ FIXME: In rootless mode the backing-store support is not functional yet.
nxagentAlphaEnabled = False;
}
if ((nxagentOption(Rootless) == True) && nxagentOption(Xdmcp))
if (nxagentOption(Rootless) && nxagentOption(Xdmcp))
{
FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n");
}
......
......@@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void)
void nxagentRedirectDefaultWindows(void)
{
if (nxagentOption(Rootless) == 1 ||
if (nxagentOption(Rootless) ||
nxagentCompositeEnable == 0)
{
#ifdef TEST
......@@ -154,7 +154,7 @@ void nxagentRedirectDefaultWindows(void)
void nxagentRedirectWindow(WindowPtr pWin)
{
if (nxagentOption(Rootless) == 0 ||
if (!nxagentOption(Rootless) ||
nxagentCompositeEnable == 0)
{
#ifdef TEST
......
......@@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
Cursor cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None;
if (nxagentOption(Rootless) == False)
if (!nxagentOption(Rootless))
{
XDefineCursor(nxagentDisplay,
nxagentInputWindows[pScreen -> myNum],
......
......@@ -1851,7 +1851,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
{
int value = X.xvisibility.state;
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value);
}
......@@ -2003,7 +2003,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
fprintf(stderr, "%s: Going to handle new UnmapNotify event.\n", __func__);
#endif
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
WindowPtr pWin;
......@@ -2019,7 +2019,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
}
}
if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 &&
if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) &&
!nxagentOption(Nested) &&
X.xmap.window != nxagentIconWindow)
{
......@@ -2034,7 +2034,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
fprintf(stderr, "%s: Going to handle new MapNotify event.\n", __func__);
#endif
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
WindowPtr pWin;
......@@ -3152,7 +3152,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay));
#endif
if (nxagentOption(Rootless) == True)
if (nxagentOption(Rootless))
{
int sendEventAnyway = 0;
......@@ -3272,7 +3272,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
return 1;
}
}
else /* (nxagentOption(Rootless) == True) */
else /* (nxagentOption(Rootless)) */
{
/*
* Save the position of the agent default window. Don't save the
......
......@@ -417,7 +417,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height);
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width,
height);
......
......@@ -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:
......@@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse)
* by the agent (for example if the focus had left the window), so
* that agent could be unable to update the mouse button state.
*/
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
XUngrabPointer(nxagentDisplay, CurrentTime);
......
......@@ -193,7 +193,7 @@ ProcChangeProperty(ClientPtr client)
return err;
else
{
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format,
(int) mode, len, (void *) &stuff[1]);
......
......@@ -59,9 +59,9 @@ void nxagentInitOptions(void)
{
nxagentOptions.LinkType = UNDEFINED;
nxagentOptions.Desktop = UNDEFINED;
nxagentOptions.Desktop = True;
nxagentOptions.Persistent = True;
nxagentOptions.Rootless = UNDEFINED;
nxagentOptions.Rootless = False;
nxagentOptions.Shadow = False;
nxagentOptions.Fullscreen = False;
nxagentOptions.AllScreens = False;
......@@ -121,7 +121,7 @@ void nxagentInitOptions(void)
nxagentOptions.UseDamage = True;
nxagentOptions.Binder = UNDEFINED;
nxagentOptions.Binder = False;
nxagentOptions.BinderOptions = NULL;
nxagentOptions.Xdmcp = False;
......
......@@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void)
nxagentRedirectDefaultWindows();
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama))
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama))
{
nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True);
......
......@@ -948,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* the screen if we are either in rootless or in fullscreen mode.
*/
if (nxagentOption(Rootless) == False && !nxagentWMIsRunning)
if (!nxagentOption(Rootless) && !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n");
......@@ -1732,7 +1732,7 @@ N/A
pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]);
#endif
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask};
......@@ -1953,7 +1953,7 @@ N/A
/* FIXME: This doing the same thing in both cases. The
comments do not seem accurate (anymore?) */
if (nxagentOption(Rootless) == False)
if (!nxagentOption(Rootless))
{
/*
* Set the WM_DELETE_WINDOW protocol for the main agent
......@@ -2377,7 +2377,7 @@ FIXME: We should try to restore the previously
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
}
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
#ifdef DEBUG
fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height);
......
......@@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin) -> corruptedTimestamp = 0;
nxagentWindowPriv(pWin) -> splitResource = NULL;
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
nxagentWindowPriv(pWin) -> isMapped = 0;
......@@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
return;
}
......@@ -1259,7 +1259,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
return;
}
if (nxagentOption(Rootless) == 1 &&
if (nxagentOption(Rootless) &&
nxagentWindowTopLevel(pWin) == 1)
{
mask &= ~(CWSibling | CWStackMode);
......@@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void)
*/
MapWindow(pWin, serverClient);
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
/*
* Show the NX splash screen.
......@@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0)
* raised.
*/
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
for (int i = 0; i < screenInfo.numScreens; i++)
{
......@@ -3274,7 +3274,7 @@ XXX: This would break Motif menus.
XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum);
}
}
else if (nxagentOption(Rootless) == 0)
else if (!nxagentOption(Rootless))
{
/*
* Map the root window.
......
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