From 42fdee57a29216aa3e16c905dda458a1a1011f1d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 25 May 2009 15:26:13 +0200 Subject: [PATCH] Revert "client, mouse: improve struts a bit" This reverts commit 47efde17f51c630f9182c5999376e335c5c383a1. Conflicts: lib/awful/mouse.lua.in screen.c --- lib/awful/mouse.lua.in | 4 ++-- screen.c | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/lib/awful/mouse.lua.in b/lib/awful/mouse.lua.in index f5da0f65..6a309392 100644 --- a/lib/awful/mouse.lua.in +++ b/lib/awful/mouse.lua.in @@ -73,14 +73,14 @@ end local function snap_inside(g, sg, snap) local edgev = 'none' local edgeh = 'none' - if math.abs(g.x) < snap + sg.x and g.x >= sg.x then + if math.abs(g.x) < snap + sg.x and g.x > sg.x then edgev = 'left' g.x = sg.x elseif math.abs((sg.x + sg.width) - (g.x + g.width)) < snap then edgev = 'right' g.x = sg.x + sg.width - g.width end - if math.abs(g.y) < snap + sg.y and g.y >= sg.y then + if math.abs(g.y) < snap + sg.y and g.y > sg.y then edgeh = 'top' g.y = sg.y elseif math.abs((sg.y + sg.height) - (g.y + g.height)) < snap then diff --git a/screen.c b/screen.c index 4fb50336..9fd2c065 100644 --- a/screen.c +++ b/screen.c @@ -163,9 +163,6 @@ screen_area_get(screen_t *screen, wibox_array_t *wiboxes, area.height -= padding->top + padding->bottom; } - /* 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) foreach(_c, globalconf.clients) { @@ -175,35 +172,35 @@ screen_area_get(screen_t *screen, wibox_array_t *wiboxes, if(c->strut.top_start_x || c->strut.top_end_x) { if(c->strut.top) - top += MIN(c->strut.top, c->geometry.height); + top = MAX(top, c->strut.top); else - top += c->geometry.height; + top = MAX(top, (c->geometry.y - area.y) + c->geometry.height); } if(c->strut.bottom_start_x || c->strut.bottom_end_x) { if(c->strut.bottom) - bottom += MIN(c->strut.bottom, c->geometry.height); + bottom = MAX(bottom, c->strut.bottom); else - bottom += c->geometry.height; + bottom = MAX(bottom, (area.y + area.height) - c->geometry.y); } if(c->strut.left_start_y || c->strut.left_end_y) { if(c->strut.left) - left += MIN(c->strut.left, c->geometry.width); + left = MAX(left, c->strut.left); else - left += c->geometry.width; + left = MAX(left, (c->geometry.x - area.x) + c->geometry.width); } if(c->strut.right_start_y || c->strut.right_end_y) { if(c->strut.right) - right += MIN(c->strut.right, c->geometry.width); + right = MAX(right, c->strut.right); else - right += c->geometry.width; + right = MAX(right, (area.x + area.width) - c->geometry.x); } } } - /* swindow geometry includes borders. */ + if(wiboxes) foreach(_w, *wiboxes) { @@ -212,16 +209,16 @@ screen_area_get(screen_t *screen, wibox_array_t *wiboxes, switch(w->position) { case Top: - top += w->sw.geometry.height; + top = MAX(top, (uint16_t) (w->sw.geometry.y - area.y) + w->sw.geometry.height + 2 * w->sw.border.width); break; case Bottom: - bottom += w->sw.geometry.height; + bottom = MAX(bottom, (uint16_t) (area.y + area.height) - w->sw.geometry.y); break; case Left: - left += w->sw.geometry.width; + left = MAX(left, (uint16_t) (w->sw.geometry.x - area.x) + w->sw.geometry.width + 2 * w->sw.border.width); break; case Right: - right += w->sw.geometry.width; + right = MAX(right, (uint16_t) (area.x + area.width) - w->sw.geometry.x); break; default: break;