Hello,
a few days ago I decided to use a wibox border and an imagebox
"separator" to put my widgets into containers, something in the lines of
wmii... anyway to the point.
I noticed that my clients were overlapping the wibox. On close
inspection I saw that I am indeed loosing 1px of the wibox - which for
example means the bottom of my graph widgets (and I worked so hard to
see those low values! :).
A small demonstration can be seen on this image:
http://sysphere.org/~anrxc/local/images/wibox-strut.png
Function wibox_update_strut would not take the border width into account
when calculating struts. When a wibox border was in use clients would
overlap the wibox. With a border of 1px we loose 1px of the wibox, but
as the wibox border increases it is "pushed" by the border nearest the
screen edge and clients steal more and more space.
Patch to change this (made on the 3.4 branch) is attached.
--
Adrian C. (anrxc) | anrxc..sysphere.org | PGP ID: D20A0618
PGP FP: 02A5 628A D8EE 2A93 996E 929F D5CB 31B7 D20A 0618
From 4a7239bbc4950f14f7dfd8fec91b3418e252ae8f Mon Sep 17 00:00:00 2001
From: Adrian C. (anrxc) <[email protected]>
Date: Wed, 30 Dec 2009 02:42:42 +0100
Subject: [PATCH] awful.wibox: take wibox border into account when updating
struts
Function wibox_update_strut would not take the border width into
account when calculating struts. When a wibox border was in use
clients would overlap the wibox. With a border of 1px we loose 1px of
the wibox, but as the wibox border increases it is "pushed" by the
border nearest the screen edge and clients steal more and more space.
Signed-off-by: Adrian C. (anrxc) <[email protected]>
---
lib/awful/wibox.lua.in | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/awful/wibox.lua.in b/lib/awful/wibox.lua.in
index 1bae18b..e458d04 100644
--- a/lib/awful/wibox.lua.in
+++ b/lib/awful/wibox.lua.in
@@ -87,13 +87,13 @@ local function wibox_update_strut(wibox)
if not wibox.visible then
wibox:struts { left = 0, right = 0, bottom = 0, top = 0 }
elseif wprop.position == "top" then
- wibox:struts { left = 0, right = 0, bottom = 0, top =
wibox.height }
+ wibox:struts { left = 0, right = 0, bottom = 0, top =
wibox.height + wibox.border_width }
elseif wprop.position == "bottom" then
- wibox:struts { left = 0, right = 0, bottom = wibox.height, top
= 0 }
+ wibox:struts { left = 0, right = 0, bottom = wibox.height +
wibox.border_width, top = 0 }
elseif wprop.position == "left" then
- wibox:struts { left = wibox.width, right = 0, bottom = 0, top
= 0 }
+ wibox:struts { left = wibox.width + wibox.border_width, right
= 0, bottom = 0, top = 0 }
elseif wprop.position == "right" then
- wibox:struts { left = 0, right = wibox.width, bottom = 0, top
= 0 }
+ wibox:struts { left = 0, right = wibox.width +
wibox.border_width, bottom = 0, top = 0 }
end
break
end
--
1.6.6