- c = cls[i]
- g = {}
-
- if i - 2 == centerwork.top_left
- then
- -- top left
- g.x = wa.x + useless_gap + global_border
- g.y = wa.y + useless_gap + global_border
- g.width = slaveLwid - 2*useless_gap - 2*bw
- g.height = slaveThei - useless_gap - 2*bw
- elseif i - 2 == centerwork.top_right
- then
- -- top right
- g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border
- g.y = wa.y + useless_gap + global_border
- g.width = slaveRwid - 2*useless_gap - 2*bw
- g.height = slaveThei - useless_gap - 2*bw
- elseif i - 2 == centerwork.bottom_left
- then
- -- bottom left
- g.x = wa.x + useless_gap + global_border
- g.y = wa.y + slaveThei + useless_gap + global_border
- g.width = slaveLwid - 2*useless_gap - 2*bw
- g.height = slaveBhei - 2*useless_gap - 2*bw
- elseif i - 2 == centerwork.bottom_right
- then
- -- bottom right
- g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border
- g.y = wa.y + slaveThei + useless_gap + global_border
- g.width = slaveRwid - 2*useless_gap - 2*bw
- g.height = slaveBhei - 2*useless_gap - 2*bw
- end
+ g.x = wa.x + slaveLwid
+ g.y = wa.y + useless_gap
+ else
+ if nbrFirstSlaves > 0 then slaveFirstDim = math.floor(wa.width / nbrFirstSlaves) end
+ if nbrSecondSlaves > 0 then slaveSecondDim = math.floor(wa.width / nbrSecondSlaves) end
+
+ g.height = mainhei - 2*c.border_width
+ g.width = wa.width - 2*useless_gap - 2*c.border_width
+
+ g.x = wa.x + useless_gap
+ g.y = wa.y + slaveThei
+ end
+
+ if g.width < 1 then g.width = 1 end
+ if g.height < 1 then g.height = 1 end
+
+ c:geometry(g)
+
+ -- Auxiliary windows.
+ if #cls <= 1 then return end
+ for i = 2,#cls do
+ local c = cls[i]
+ local g = {}