diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-02-13 12:32:06 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-02-13 12:32:06 +0100 |
commit | b61934be2e9b4a8d3112270b0e691d47f99ba39f (patch) | |
tree | d0cb58feeddb553a6e9ab6daea5056bd0221eb2b /nx-X11/programs/Xserver/hw/nxagent/Screen.c | |
parent | 427ac344c53acf4cb361f24e1df771137f83ea6b (diff) | |
parent | 16cd2bbe1c4425e3fa557f9ca0723aa94a50b071 (diff) | |
download | nx-libs-b61934be2e9b4a8d3112270b0e691d47f99ba39f.tar.gz nx-libs-b61934be2e9b4a8d3112270b0e691d47f99ba39f.tar.bz2 nx-libs-b61934be2e9b4a8d3112270b0e691d47f99ba39f.zip |
Merge branch 'uli42-pr/misc' into 3.6.x
Attributes GH PR #766: https://github.com/ArcticaProject/nx-libs/pull/766
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Screen.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 100 |
1 files changed, 48 insertions, 52 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 19057dfe1..ac9d6cc75 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -596,7 +596,7 @@ FIXME: Do we need to check the key grab if the raise(SIGTERM); } - else if (nxagentOption(Persistent) == 0) + else if (!nxagentOption(Persistent)) { fprintf(stderr, "Info: Terminating session with persistence not allowed.\n"); @@ -871,7 +871,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, pScreen->myNum); #endif - if (nxagentRenderEnable && nxagentReconnectTrap == False) + if (nxagentRenderEnable && !nxagentReconnectTrap) { PictureScreenPrivateIndex = -1; } @@ -885,10 +885,10 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, #endif /* - * Forced geometry parameter to user geometry. + * Force geometry parameter to user geometry except if in rootless mode. */ - if (nxagentResizeDesktopAtStartup) + if (nxagentResizeDesktopAtStartup && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -922,9 +922,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, /* * This is first time the screen is initialized. * Filling the geometry parameter from user geometry. + * we do not need this in rootless mode since we ignore + * user geometry then. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -968,7 +970,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * 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"); @@ -977,7 +979,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(Fullscreen, True); if (nxagentOption(ClientOs) == ClientOsWinnt && - (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) + (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)) { NXSetExposeParameters(nxagentDisplay, 0, 0, 0); } @@ -986,7 +988,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, if (nxagentOption(Fullscreen) && nxagentWMIsRunning && nxagentReconnectTrap && - nxagentResizeDesktopAtStartup == False && + !nxagentResizeDesktopAtStartup && nxagentXServerGeometryChanged()) { #ifdef TEST @@ -1017,7 +1019,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(Height, h); /* first time screen initialization or resize during reconnect */ - if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) + if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup) { if (nxagentOption(RootWidth) >= w) { @@ -1050,13 +1052,27 @@ 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 + * screen is initialized for the first time. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { nxagentChangeOption(RootX, 0); nxagentChangeOption(RootY, 0); @@ -1080,26 +1096,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); } /* @@ -1109,7 +1111,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * the root window isn't bigger than the X server root window.. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { if ((nxagentOption(RootWidth) < w) && !(nxagentUserGeometry.flag & WidthValue)) @@ -1135,19 +1137,13 @@ 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)); nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { if (nxagentOption(Persistent)) { @@ -1348,11 +1344,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, rootDepth, (long unsigned int)defaultVisual); #endif - if ((monitorResolution < 1) && (nxagentAutoDPI == False)) + if ((monitorResolution < 1) && !nxagentAutoDPI) { monitorResolution = NXAGENT_DEFAULT_DPI; } - else if ((monitorResolution < 1) && (nxagentAutoDPI == True)) + else if ((monitorResolution < 1) && nxagentAutoDPI) { monitorResolution = NXAGENT_AUTO_DPI; } @@ -1703,21 +1699,21 @@ N/A #endif if (nxagentDoFullGeneration == 1 || - nxagentReconnectTrap == 1) + nxagentReconnectTrap) { valuemask = CWBackPixel | CWEventMask | CWColormap | - (nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0); + (nxagentOption(AllScreens) ? CWOverrideRedirect : 0); attributes.background_pixel = nxagentBlackPixel; attributes.event_mask = nxagentGetDefaultEventMask(); attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { attributes.override_redirect = True; } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { if (nxagentReconnectTrap) { @@ -1753,7 +1749,7 @@ N/A * handling the splash screen. */ - if (nxagentOption(Rootless) == True) + if (nxagentOption(Rootless)) { nxagentDefaultWindows[pScreen->myNum] = DefaultRootWindow(nxagentDisplay); @@ -1780,7 +1776,7 @@ N/A nxagentDefaultVisual(pScreen), valuemask, &attributes); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { valuemask = CWEventMask; mask = PointerMotionMask; @@ -1888,7 +1884,7 @@ N/A sizeHints->width = nxagentOption(RootWidth); sizeHints->height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) + if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen)) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -2004,7 +2000,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 @@ -2053,7 +2049,7 @@ N/A * and pointer settings. */ - if (nxagentOption(DeviceControl) == False) + if (!nxagentOption(DeviceControl)) { fprintf(stderr, "Info: Not using local device configuration changes.\n"); } @@ -2432,13 +2428,13 @@ 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); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); } @@ -2593,7 +2589,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) NXShadowSetDisplayUid(nxagentShadowUid); } - if (nxagentOption(UseDamage) == 0) + if (!nxagentOption(UseDamage)) { NXShadowDisableDamage(); } @@ -2638,7 +2634,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) #ifndef __CYGWIN32__ - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); @@ -4575,7 +4571,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)); |