wibox: check floating size

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-03 17:54:56 +01:00
parent 76a77cf070
commit 993f83b788
1 changed files with 57 additions and 54 deletions

111
wibox.c
View File

@ -282,72 +282,73 @@ wibox_position_update(wibox_t *wibox)
&globalconf.screens[wibox->screen].padding, true); &globalconf.screens[wibox->screen].padding, true);
/* Top and Bottom wibox_t have prio */ /* Top and Bottom wibox_t have prio */
for(int i = 0; i < globalconf.screens[wibox->screen].wiboxes.len; i++) if(wibox->position != Floating)
{ for(int i = 0; i < globalconf.screens[wibox->screen].wiboxes.len; i++)
wibox_t *w = globalconf.screens[wibox->screen].wiboxes.tab[i];
/* Ignore every wibox after me that is in the same position */
if(wibox == w)
{ {
ignore = true; wibox_t *w = globalconf.screens[wibox->screen].wiboxes.tab[i];
continue; /* Ignore every wibox after me that is in the same position */
} if(wibox == w)
else if((ignore && wibox->position == w->position) || !w->isvisible)
continue;
switch(w->position)
{
case Floating:
break;
case Left:
switch(wibox->position)
{ {
ignore = true;
continue;
}
else if((ignore && wibox->position == w->position) || !w->isvisible)
continue;
switch(w->position)
{
case Floating:
break;
case Left: case Left:
area.x += wibox->sw.geometry.height; switch(wibox->position)
{
case Left:
area.x += wibox->sw.geometry.height;
break;
default:
break;
}
break; break;
default:
break;
}
break;
case Right:
switch(wibox->position)
{
case Right: case Right:
area.x -= wibox->sw.geometry.height; switch(wibox->position)
{
case Right:
area.x -= wibox->sw.geometry.height;
break;
default:
break;
}
break; break;
default:
break;
}
break;
case Top:
switch(wibox->position)
{
case Top: case Top:
area.y += w->sw.geometry.height; switch(wibox->position)
{
case Top:
area.y += w->sw.geometry.height;
break;
case Left:
case Right:
area.height -= w->sw.geometry.height;
area.y += w->sw.geometry.height;
break;
default:
break;
}
break; break;
case Left:
case Right:
area.height -= w->sw.geometry.height;
area.y += w->sw.geometry.height;
break;
default:
break;
}
break;
case Bottom:
switch(wibox->position)
{
case Bottom: case Bottom:
area.y -= w->sw.geometry.height; switch(wibox->position)
break; {
case Left: case Bottom:
case Right: area.y -= w->sw.geometry.height;
area.height -= w->sw.geometry.height; break;
break; case Left:
default: case Right:
area.height -= w->sw.geometry.height;
break;
default:
break;
}
break; break;
} }
break;
} }
}
switch(wibox->position) switch(wibox->position)
{ {
@ -423,6 +424,8 @@ wibox_position_update(wibox_t *wibox)
} }
break; break;
case Floating: case Floating:
wingeom.width = MAX(1, wibox->sw.geometry.width);
wingeom.height = MAX(1, wibox->sw.geometry.height);
break; break;
} }