I haven't tested this, so at least farhaven should test this, since he complained about the regression.

Maarten.
>From 05e3f40060c726f12883080b1e9f2a24409d7c73 Mon Sep 17 00:00:00 2001
From: Maarten Maathuis <[EMAIL PROTECTED]>
Date: Wed, 10 Dec 2008 16:59:24 +0100
Subject: [PATCH] wibox: Keep the "width" of a wibox if available.

Signed-off-by: Maarten Maathuis <[EMAIL PROTECTED]>
---
 wibox.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/wibox.c b/wibox.c
index 0fb1aa2..a1a6df1 100644
--- a/wibox.c
+++ b/wibox.c
@@ -360,14 +360,14 @@ wibox_position_update(wibox_t *wibox)
             }
         }
 
-    /* Width and height are always chosen as optimal size given size 
constraints.
-     * Anything else produces either wiboxes that are too small or too large.
+    /* The "length" of a wibox is always chosen to be the optimal size 
(non-floating).
+     * The "width" of a wibox is kept if it exists.
      */
     switch(wibox->position)
     {
       case Right:
         wingeom.height = area.height - 2 * wibox->sw.border.width;
-        wingeom.width = 1.5 * globalconf.font->height;
+        wingeom.width = wibox->sw.geometry.width > 0 ? 
wibox->sw.geometry.width : 1.5 * globalconf.font->height;
         wingeom.x = area.x + area.width - wingeom.width - 2 * 
wibox->sw.border.width;
         switch(wibox->align)
         {
@@ -384,7 +384,7 @@ wibox_position_update(wibox_t *wibox)
         break;
       case Left:
         wingeom.height = area.height - 2 * wibox->sw.border.width;
-        wingeom.width = 1.5 * globalconf.font->height;
+        wingeom.width = wibox->sw.geometry.width > 0 ? 
wibox->sw.geometry.width : 1.5 * globalconf.font->height;
         wingeom.x = area.x;
         switch(wibox->align)
         {
@@ -399,7 +399,7 @@ wibox_position_update(wibox_t *wibox)
         }
         break;
       case Bottom:
-        wingeom.height = 1.5 * globalconf.font->height;
+        wingeom.height = wibox->sw.geometry.height > 0 ? 
wibox->sw.geometry.height : 1.5 * globalconf.font->height;
         wingeom.width = area.width - 2 * wibox->sw.border.width;
         wingeom.y = (area.y + area.height) - wingeom.height - 2 * 
wibox->sw.border.width;
         wingeom.x = area.x;
@@ -416,7 +416,7 @@ wibox_position_update(wibox_t *wibox)
         }
         break;
       case Top:
-        wingeom.height = 1.5 * globalconf.font->height;
+        wingeom.height = wibox->sw.geometry.height > 0 ? 
wibox->sw.geometry.height : 1.5 * globalconf.font->height;
         wingeom.width = area.width - 2 * wibox->sw.border.width;
         wingeom.x = area.x;
         wingeom.y = area.y;
-- 
1.6.0.4

Reply via email to