aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-02-07 23:04:23 +0100
committerUlrich Sibiller <uli42@gmx.de>2019-02-11 13:31:33 +0100
commit34e4291de2c261f9dd047a7e18cf46eeaf84662a (patch)
tree176feae0a6ed4aec5865ad90eeda91fb16cec7ba /nx-X11
parentf729ac996cef9fef7fe963b7b6c9de93fc8eb2cf (diff)
downloadnx-libs-34e4291de2c261f9dd047a7e18cf46eeaf84662a.tar.gz
nx-libs-34e4291de2c261f9dd047a7e18cf46eeaf84662a.tar.bz2
nx-libs-34e4291de2c261f9dd047a7e18cf46eeaf84662a.zip
Screen.c: simplify and fix handling of rootless mode
Fixes: ArcticaProject/nx-libs#765
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 19057dfe1..103cd1dbf 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -1050,8 +1050,22 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(RootY, (h - nxagentOption(RootHeight)) / 2);
}
}
- else
+ else if (nxagentOption(Rootless))
{
+ nxagentChangeOption(X, 0);
+ nxagentChangeOption(Y, 0);
+
+ nxagentChangeOption(RootX, 0);
+ nxagentChangeOption(RootY, 0);
+
+ nxagentChangeOption(RootWidth, w);
+ nxagentChangeOption(RootHeight, h);
+
+ nxagentChangeOption(Width, w);
+ nxagentChangeOption(Height, h);
+ }
+ else /* window mode */
+ {
/*
* screen is initialized for the first time
*/
@@ -1080,26 +1094,12 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if (nxagentOption(Width) > w)
{
- if (nxagentOption(Rootless))
- {
- nxagentChangeOption(Width, w);
- }
- else
- {
- nxagentChangeOption(Width, w * 3 / 4);
- }
+ nxagentChangeOption(Width, w * 3 / 4);
}
if (nxagentOption(Height) > h)
{
- if (nxagentOption(Rootless))
- {
- nxagentChangeOption(Height, h);
- }
- else
- {
- nxagentChangeOption(Height, h * 3 / 4);
- }
+ nxagentChangeOption(Height, h * 3 / 4);
}
/*
@@ -1135,12 +1135,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
nxagentChangeOption(SavedHeight, nxagentOption(RootHeight));
}
- if (nxagentOption(Rootless))
- {
- nxagentChangeOption(RootWidth, w);
- nxagentChangeOption(RootHeight, h);
- }
-
nxagentChangeOption(SavedRootWidth, nxagentOption(RootWidth));
nxagentChangeOption(SavedRootHeight, nxagentOption(RootHeight));