From db68ae2ebe36765f7d884a97c43043cf87d7609b Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Mon, 30 Mar 2009 19:40:02 +0200 Subject: [PATCH] screen, client: clamp strut size to relevant dimension - gnome-panel (for example) requests the space for all it's windows - this approach can never work for multiple applications, so we clamp it Signed-off-by: Julien Danjou --- screen.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/screen.c b/screen.c index c75453fc..adf023b1 100644 --- a/screen.c +++ b/screen.c @@ -176,7 +176,9 @@ screen_area_get(int screen, wibox_array_t *wiboxes, area.height -= padding->top + padding->bottom; } - /* struts are additive, to allow for multiple clients at the screen edge. */ + /* Struts are additive, to allow for multiple clients at the screen edge. */ + /* Some clients request more space than their size, because another window of the same app already has some space. */ + /* So we clamp the strut size. */ if(strut) { client_t *c; @@ -186,28 +188,28 @@ screen_area_get(int screen, wibox_array_t *wiboxes, if(c->strut.top_start_x || c->strut.top_end_x) { if(c->strut.top) - top += c->strut.top; + top += MIN(c->strut.top, c->geometry.height); else top += c->geometry.height; } if(c->strut.bottom_start_x || c->strut.bottom_end_x) { if(c->strut.bottom) - bottom += c->strut.bottom; + bottom += MIN(c->strut.bottom, c->geometry.height); else bottom += c->geometry.height; } if(c->strut.left_start_y || c->strut.left_end_y) { if(c->strut.left) - left += c->strut.left; + left += MIN(c->strut.left, c->geometry.width); else left += c->geometry.width; } if(c->strut.right_start_y || c->strut.right_end_y) { if(c->strut.right) - right += c->strut.right; + right += MIN(c->strut.right, c->geometry.width); else right += c->geometry.width; }