Revert "client, mouse: improve struts a bit"

This reverts commit 47efde17f5.

Conflicts:

	lib/awful/mouse.lua.in
	screen.c
This commit is contained in:
Julien Danjou 2009-05-25 15:26:13 +02:00
parent fba4accc14
commit 42fdee57a2
2 changed files with 15 additions and 18 deletions

View File

@ -73,14 +73,14 @@ end
local function snap_inside(g, sg, snap) local function snap_inside(g, sg, snap)
local edgev = 'none' local edgev = 'none'
local edgeh = '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' edgev = 'left'
g.x = sg.x g.x = sg.x
elseif math.abs((sg.x + sg.width) - (g.x + g.width)) < snap then elseif math.abs((sg.x + sg.width) - (g.x + g.width)) < snap then
edgev = 'right' edgev = 'right'
g.x = sg.x + sg.width - g.width g.x = sg.x + sg.width - g.width
end 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' edgeh = 'top'
g.y = sg.y g.y = sg.y
elseif math.abs((sg.y + sg.height) - (g.y + g.height)) < snap then elseif math.abs((sg.y + sg.height) - (g.y + g.height)) < snap then

View File

@ -163,9 +163,6 @@ screen_area_get(screen_t *screen, wibox_array_t *wiboxes,
area.height -= padding->top + padding->bottom; 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) if(strut)
foreach(_c, globalconf.clients) 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_start_x || c->strut.top_end_x)
{ {
if(c->strut.top) if(c->strut.top)
top += MIN(c->strut.top, c->geometry.height); top = MAX(top, c->strut.top);
else 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_start_x || c->strut.bottom_end_x)
{ {
if(c->strut.bottom) if(c->strut.bottom)
bottom += MIN(c->strut.bottom, c->geometry.height); bottom = MAX(bottom, c->strut.bottom);
else 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_start_y || c->strut.left_end_y)
{ {
if(c->strut.left) if(c->strut.left)
left += MIN(c->strut.left, c->geometry.width); left = MAX(left, c->strut.left);
else 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_start_y || c->strut.right_end_y)
{ {
if(c->strut.right) if(c->strut.right)
right += MIN(c->strut.right, c->geometry.width); right = MAX(right, c->strut.right);
else else
right += c->geometry.width; right = MAX(right, (area.x + area.width) - c->geometry.x);
} }
} }
} }
/* swindow geometry includes borders. */
if(wiboxes) if(wiboxes)
foreach(_w, *wiboxes) foreach(_w, *wiboxes)
{ {
@ -212,16 +209,16 @@ screen_area_get(screen_t *screen, wibox_array_t *wiboxes,
switch(w->position) switch(w->position)
{ {
case Top: 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; break;
case Bottom: case Bottom:
bottom += w->sw.geometry.height; bottom = MAX(bottom, (uint16_t) (area.y + area.height) - w->sw.geometry.y);
break; break;
case Left: 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; break;
case Right: case Right:
right += w->sw.geometry.width; right = MAX(right, (uint16_t) (area.x + area.width) - w->sw.geometry.x);
break; break;
default: default:
break; break;