client: fix returned value for non transient windows
[awesome.git] / layouts / max.c
blobb2805c8e6f37e69c0dd35670ef63815a5799e89e
1 /*
2 * max.c - max layout
4 * Copyright © 2007-2008 Julien Danjou <julien@danjou.info>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "tag.h"
23 #include "screen.h"
24 #include "client.h"
25 #include "layouts/max.h"
27 extern awesome_t globalconf;
29 static void
30 layout_fmax(int screen, bool fs)
32 client_t *c;
33 int phys_screen = screen_virttophys(screen);
34 area_t area = screen_area_get(screen,
35 fs ? NULL : &globalconf.screens[screen].wiboxes,
36 fs ? NULL : &globalconf.screens[screen].padding,
37 true);
39 for(c = globalconf.clients; c; c = c->next)
40 if(IS_TILED(c, screen))
42 area.width -= 2 * c->border;
43 area.height -= 2 * c->border;
44 client_resize(c, area, false);
45 area.width += 2 * c->border;
46 area.height += 2 * c->border;
49 if(IS_TILED(globalconf.screens[phys_screen].client_focus, screen))
50 client_raise(globalconf.screens[phys_screen].client_focus);
53 void
54 layout_max(int screen)
56 return layout_fmax(screen, false);
59 void
60 layout_fullscreen(int screen)
62 return layout_fmax(screen, true);
65 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80