[X2Go-Commits] [nx-libs] 83/429: nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as Booleans

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:10 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit a85adf5ea25ed8c3b7f72ffbd04cda0122f1b5a1
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Wed Dec 30 19:27:15 2020 +0100

    nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as Booleans
    
    The already where Booleans but where not using True/False values everywhere
---
 nx-X11/programs/Xserver/hw/nxagent/Args.c       |  6 +++---
 nx-X11/programs/Xserver/hw/nxagent/Events.c     | 10 +++++-----
 nx-X11/programs/Xserver/hw/nxagent/Extensions.c |  8 ++++----
 nx-X11/programs/Xserver/hw/nxagent/Options.c    |  2 +-
 nx-X11/programs/Xserver/hw/nxagent/Screen.c     |  6 +++---
 nx-X11/programs/Xserver/hw/nxagent/Window.c     |  6 +++---
 6 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 554f7ae38..6d63f768a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -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
     {
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 471e3f6a1..f2f9c5119 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -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))
         {
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
index 835d05d19..77f2d6b38 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
@@ -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);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c
index 660aa9a4d..d4a7479e3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Options.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c
@@ -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;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index f5aa11e5f..d8f79f015 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -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));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index ab61c101b..f1c21e12c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -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();
     }

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list