aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-12-30 19:20:56 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-01-15 16:38:11 +0100
commit6e9b3a7f8872e79c81b1f9096a7cde9fd46d24f6 (patch)
treea0fda798e69555dc50cd4931f8b5ae46a9fe940f
parent262fe771cceda4a984be603ccb3d8f6563706741 (diff)
downloadnx-libs-6e9b3a7f8872e79c81b1f9096a7cde9fd46d24f6.tar.gz
nx-libs-6e9b3a7f8872e79c81b1f9096a7cde9fd46d24f6.tar.bz2
nx-libs-6e9b3a7f8872e79c81b1f9096a7cde9fd46d24f6.zip
nxagent: make Fullscreen and AllScreens Booleans
There's no need/sense in having a tri-state with the third state being UNDEFINED.
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c14
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Extensions.c12
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Options.c3
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c13
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c4
6 files changed, 29 insertions, 35 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 1ae1b570b..554f7ae38 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -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;
}
@@ -1749,7 +1749,7 @@ N/A
#endif
- if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1)
+ if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen))
{
#ifdef TEST
fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n");
@@ -1974,16 +1974,6 @@ N/A
* 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);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 332cb2f32..471e3f6a1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -575,7 +575,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE);
- if (nxagentOption(Fullscreen) == 0)
+ if (!nxagentOption(Fullscreen))
{
nxagentSetWMNormalHintsMaxsize(pScreen,
nxagentOption(RootWidth),
@@ -1724,7 +1724,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
nxagentScreenTrap = False;
}
- if (nxagentOption(Fullscreen) == 1 &&
+ if (nxagentOption(Fullscreen) &&
X.xcrossing.window == nxagentFullscreenWindow &&
X.xcrossing.detail != NotifyInferior)
{
@@ -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)
{
@@ -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;
nxagentVisibilityStop = False;
@@ -2185,7 +2185,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
if (switchFullscreen)
{
- if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(AllScreens) && nxagentOption(Fullscreen))
{
nxagentSwitchAllScreens(pScreen, 0);
}
@@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
if (switchAllScreens)
{
- if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1)
+ if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen))
{
nxagentSwitchFullscreen(pScreen, False);
}
@@ -3291,7 +3291,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum])
{
- if (nxagentOption(AllScreens) == 0)
+ if (!nxagentOption(AllScreens))
{
/*
* - WITHOUT window manager any position change is relevant
@@ -3409,7 +3409,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0,
X -> xconfigure.width, X -> xconfigure.height);
- if (nxagentOption(Fullscreen) == 0)
+ if (!nxagentOption(Fullscreen))
{
/* FIXME: has already been done some lines above */
nxagentMoveViewport(pScreen, 0, 0);
@@ -3592,7 +3592,7 @@ int nxagentHandleReparentNotify(XEvent* X)
return 1;
}
- else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 &&
+ else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) &&
nxagentOption(WMBorderWidth) == -1)
{
/*
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
index 52c3b0375..835d05d19 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
@@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
{
if (width == 0)
{
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
@@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
if (height == 0)
{
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
@@ -430,7 +430,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 &&
- (nxagentOption(Fullscreen) == 1 ||
+ (nxagentOption(Fullscreen) ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
{
@@ -441,8 +441,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
}
}
- if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 &&
- nxagentOption(AllScreens) == 0)
+ if (nxagentOption(DesktopResize) == 1 && !nxagentOption(Fullscreen) &&
+ !nxagentOption(AllScreens))
{
nxagentChangeOption(Width, width);
nxagentChangeOption(Height, height);
@@ -451,7 +451,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True);
if (result == 1 && nxagentOption(DesktopResize) == 1 &&
- nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)
+ !nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{
nxagentRandRSetWindowsSize(width, height);
nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c
index 0da504f06..660aa9a4d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Options.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c
@@ -62,7 +62,8 @@ void nxagentInitOptions(void)
nxagentOptions.Desktop = UNDEFINED;
nxagentOptions.Persistent = 1;
nxagentOptions.Rootless = UNDEFINED;
- nxagentOptions.Fullscreen = UNDEFINED;
+ nxagentOptions.Fullscreen = False;
+ nxagentOptions.AllScreens = False;
nxagentOptions.NoRootlessExit = False;
nxagentOptions.X = 0;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 148f9e1dd..f5aa11e5f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix)
fprintf(stderr, "%s | Fullscreen is %s.\n", prefix,
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,
nxagentOption(DesktopResize) ? "ON" : "OFF");
@@ -1664,13 +1667,13 @@ N/A
.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen))
};
- if (nxagentOption(AllScreens) == 1)
+ if (nxagentOption(AllScreens))
{
valuemask |= CWOverrideRedirect;
attributes.override_redirect = True;
}
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
if (nxagentReconnectTrap)
{
@@ -1833,7 +1836,7 @@ N/A
sizeHints->width = nxagentOption(RootWidth);
sizeHints->height = nxagentOption(RootHeight);
- if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen))
{
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
@@ -2362,7 +2365,7 @@ FIXME: We should try to restore the previously
* Change agent window size and size hints.
*/
- if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0))
+ if (!(nxagentOption(Fullscreen) || nxagentOption(AllScreens)))
{
nxagentSetWMNormalHints(pScreen->myNum, width, height);
@@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
return -1;
}
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth,
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index 2dea31af0..ab61c101b 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin)
void nxagentUnmapWindows(void)
{
- if (nxagentOption(Fullscreen) == 1)
+ if (nxagentOption(Fullscreen))
{
for (int i = 0; i < screenInfo.numScreens; i++)
{
@@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
- if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning)
+ if (nxagentOption(Fullscreen) && nxagentWMIsRunning)
{
nxagentMaximizeToFullScreen(pScreen);
}