changeset 3256:58692458e727

Tidied up code
author unexist
date Tue, 19 Dec 2017 12:00:25 +0100
parents 075fd86262e3
children e7dc7dc9b1f8 7745d5f9a9d6
files src/subtle/client.c
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Fri Dec 15 14:36:18 2017 +0100
+++ b/src/subtle/client.c	Tue Dec 19 12:00:25 2017 +0100
@@ -101,8 +101,8 @@
       /* Center client on current gravity */
       if(!(c->flags & SUB_CLIENT_MODE_FLOAT))
         {
-          geom->x += 0 < diffw ? diffw / 2 : 0;
-          geom->y += 0 < diffh ? diffh / 2 : 0;
+          geom->x += 0 < diffw ? (diffw / 2) : 0;
+          geom->y += 0 < diffh ? (diffh / 2) : 0;
         }
 
       geom->width  -= diffw;
@@ -1060,17 +1060,15 @@
     {
       if(c->flags & SUB_CLIENT_ARRANGE || (-1 != screenid && c->screenid != screenid))
         {
-          SubScreen *s2 = SCREEN(subArrayGet(subtle->screens,
+          SubScreen *old_s = SCREEN(subArrayGet(subtle->screens,
             -1 != c->screenid ? c->screenid : 0));
 
           /* Update screen offsets */
-          if(s != s2)
+          if(screenid != c->screenid)
             {
-              c->geom.x      = c->geom.x - s2->geom.x + s->geom.x;
-              c->geom.y      = c->geom.y - s2->geom.y + s->geom.y;
-              c->geom.width  = c->geom.width;
-              c->geom.height = c->geom.height;
-              c->screenid    = screenid;
+              c->geom.x   = c->geom.x - old_s->geom.x + s->geom.x;
+              c->geom.y   = c->geom.y - old_s->geom.y + s->geom.y;
+              c->screenid = screenid;
             }
 
           /* Finally resize window */
@@ -1142,6 +1140,9 @@
             (void *)c);
         }
     }
+
+  /* Remove arrange flag */
+  c->flags &= ~SUB_CLIENT_ARRANGE;
 } /* }}} */
 
  /** subClientToggle {{{