All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
4 Licensed under GNU General Public License v2
6 * (c) 2013, Luke Bonham
7 * (c) 2010-2012, Peter Hofmann
11 local tag = require("awful.tag")
12 local beautiful = require("beautiful")
22 function cascade.arrange(p)
26 -- A global border can be defined with
27 -- beautiful.global_border_width.
28 local global_border = tonumber(beautiful.global_border_width) or 0
29 if global_border < 0 then global_border = 0 end
35 wa.height = wa.height - (global_border * 2)
36 wa.width = wa.width - (global_border * 2)
37 wa.x = wa.x + global_border
38 wa.y = wa.y + global_border
40 -- Opening a new window will usually force all existing windows to
41 -- get resized. This wastes a lot of CPU time. So let's set a lower
42 -- bound to "how_many": This wastes a little screen space but you'll
43 -- get a much better user experience.
44 local t = tag.selected(p.screen)
46 if cascade.nmaster > 0
48 num_c = cascade.nmaster
50 num_c = tag.getnmaster(t)
59 local current_offset_x = cascade.offset_x * (how_many - 1)
60 local current_offset_y = cascade.offset_y * (how_many - 1)
68 g.x = wa.x + (how_many - i) * cascade.offset_x
69 g.y = wa.y + (i - 1) * cascade.offset_y
70 g.width = wa.width - current_offset_x - 2*c.border_width
71 g.height = wa.height - current_offset_y - 2*c.border_width
72 if g.width < 1 then g.width = 1 end
73 if g.height < 1 then g.height = 1 end