[Xfce4-commits] [xfce/xfwm4] 01/01: Take account of panels reserved space for tilling

noreply at xfce.org noreply at xfce.org
Thu Jan 8 22:17:28 CET 2015


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

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit 918a7f2a0dba7265bac51222532d186b94012446
Author: Alberto <cratiport at gmail.com>
Date:   Wed Jun 4 20:58:04 2014 +0200

    Take account of panels reserved space for tilling
    
    Bug: 8764
---
 src/client.c |   40 +++++++++++-----------------------------
 1 file changed, 11 insertions(+), 29 deletions(-)

diff --git a/src/client.c b/src/client.c
index 2605780..231cdd2 100644
--- a/src/client.c
+++ b/src/client.c
@@ -3167,12 +3167,7 @@ clientNewMaxSize (Client *c, XWindowChanges *wc, GdkRectangle *rect, tilePositio
 {
     ScreenInfo *screen_info;
     int full_x, full_y, full_w, full_h;
-    int tmp_x, tmp_y, tmp_w, tmp_h;
 
-    tmp_x = frameExtentX (c);
-    tmp_y = frameExtentY (c);
-    tmp_h = frameExtentHeight (c);
-    tmp_w = frameExtentWidth (c);
     screen_info = c->screen_info;
 
     full_x = MAX (screen_info->params->xfwm_margins[STRUTS_LEFT], rect->x);
@@ -3182,10 +3177,11 @@ clientNewMaxSize (Client *c, XWindowChanges *wc, GdkRectangle *rect, tilePositio
     full_h = MIN (screen_info->height - screen_info->params->xfwm_margins[STRUTS_BOTTOM],
                   rect->y + rect->height) - full_y;
 
+    /* Adjust size to the largest size available, not covering struts */
+    clientMaxSpace (screen_info, &full_x, &full_y, &full_w, &full_h);
+
     if (FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED))
     {
-        /* Adjust size to the largest size available, not covering struts */
-        clientMaxSpace (screen_info, &full_x, &full_y, &full_w, &full_h);
         wc->x = full_x + frameExtentLeft (c);
         wc->y = full_y + frameExtentTop (c);
         wc->width = full_w - frameExtentLeft (c) - frameExtentRight (c);
@@ -3200,21 +3196,14 @@ clientNewMaxSize (Client *c, XWindowChanges *wc, GdkRectangle *rect, tilePositio
         switch (tile)
         {
             case TILE_UP:
-                tmp_h = full_h / 2;
-                tmp_y = full_y;
-                clientMaxSpace (screen_info, &full_x, &tmp_y, &full_w, &tmp_h);
-                wc->y = tmp_y + frameExtentTop (c);
-                wc->height = tmp_h - frameExtentTop (c) - frameExtentBottom (c);
+                wc->y = full_y + frameTop (c);
+                wc->height = full_h / 2 - frameTop (c) - frameBottom (c);
                 break;
             case TILE_DOWN:
-                tmp_h = full_h / 2;
-                tmp_y = full_y + full_h / 2;
-                clientMaxSpace (screen_info, &full_x, &tmp_y, &full_w, &tmp_h);
-                wc->y = tmp_y + frameExtentTop (c);
-                wc->height = tmp_h - frameExtentTop (c) - frameExtentBottom (c);
+                wc->y = full_y + full_h / 2 + frameTop (c);
+                wc->height = full_h - full_h / 2 - frameTop (c) - frameBottom (c);
                 break;
             default:
-                clientMaxSpace (screen_info, &full_x, &tmp_y, &full_w, &tmp_h);
                 break;
         }
 
@@ -3230,21 +3219,14 @@ clientNewMaxSize (Client *c, XWindowChanges *wc, GdkRectangle *rect, tilePositio
         switch (tile)
         {
             case TILE_LEFT:
-                tmp_x = full_x;
-                tmp_w = full_w / 2;
-                clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h);
-                wc->x = tmp_x + frameExtentLeft (c);
-                wc->width = tmp_w - frameExtentLeft (c) - frameExtentRight (c);
+                wc->x = full_x + frameLeft (c);
+                wc->width = full_w / 2 - frameLeft (c) - frameRight (c);
                 break;
             case TILE_RIGHT:
-                tmp_x = full_x + full_w /2;
-                tmp_w = full_w / 2;
-                clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h);
-                wc->x = tmp_x + frameExtentLeft (c);
-                wc->width = tmp_w - frameExtentLeft (c) - frameExtentRight (c);
+                wc->x = full_x + full_w / 2 + frameLeft (c);
+                wc->width = full_w - full_w / 2 - frameLeft (c) - frameRight (c);
                 break;
             default:
-                clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h);
                 break;
         }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list