magnifier: use all space if no other window

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-24 10:12:46 +02:00
parent 6fc677c441
commit 9161fd0b2c
1 changed files with 14 additions and 9 deletions

View File

@ -48,22 +48,27 @@ layout_magnifier(int screen)
if(!focus) if(!focus)
goto bailout; goto bailout;
geometry.width = area.width * sqrt(curtags[0]->mwfact);
geometry.height = area.height * sqrt(curtags[0]->mwfact);
geometry.x = area.x + (area.width - geometry.width) / 2;
geometry.y = area.y + (area.height - geometry.height) / 2;
client_resize(focus, geometry, focus->honorsizehints);
client_raise(focus);
for(c = client_list_prev_cycle(&globalconf.clients, focus); for(c = client_list_prev_cycle(&globalconf.clients, focus);
c && c != focus; c && c != focus;
c = client_list_prev_cycle(&globalconf.clients, c)) c = client_list_prev_cycle(&globalconf.clients, c))
if(IS_TILED(c, screen) && c != focus) if(IS_TILED(c, screen) && c != focus)
n++; n++;
/* No other clients. */ if(n)
if(!n) {
geometry.width = area.width * sqrt(curtags[0]->mwfact);
geometry.height = area.height * sqrt(curtags[0]->mwfact);
geometry.x = area.x + (area.width - geometry.width) / 2;
geometry.y = area.y + (area.height - geometry.height) / 2;
}
else
{
/* No other clients. */
geometry = area;
goto bailout; goto bailout;
}
client_resize(focus, geometry, focus->honorsizehints);
client_raise(focus);
geometry.x = area.x; geometry.x = area.x;
geometry.y = area.y; geometry.y = area.y;