diff --git a/lib/awful/layout/init.lua b/lib/awful/layout/init.lua index d820fa8d4..f3c75941b 100644 --- a/lib/awful/layout/init.lua +++ b/lib/awful/layout/init.lua @@ -182,12 +182,18 @@ function layout.parameters(t, screen) gap_single_client = t.gap_single_client end + local gap_mult_client = true + + if(t and t.gap_mult_client ~= nil) then + gap_mult_client = t.gap_mult_client + end + local useless_gap = 0 if t then local skip_gap = layout.get(screen).skip_gap or function(nclients) return nclients < 2 end - if gap_single_client or not skip_gap(#clients, t) then + if (gap_single_client and skip_gap(#clients, t)) or (not skip_gap(#clients, t) and gap_mult_client) then useless_gap = t.gap end end diff --git a/lib/awful/tag.lua b/lib/awful/tag.lua index fcd8f1b4f..7b7decc25 100644 --- a/lib/awful/tag.lua +++ b/lib/awful/tag.lua @@ -50,6 +50,7 @@ defaults.gap = 0 -- The default gap_count. defaults.gap_single_client = true +defaults.gap_mult_client = true -- The default master fill policy. defaults.master_fill_policy = "expand" @@ -1173,6 +1174,29 @@ function tag.object.get_gap_single_client(t) return defaults.gap_single_client end +--- Enable gaps for mult client. +-- +-- @beautiful beautiful.gap_mult_client +-- @param boolean (default: true) +-- @see gap +-- @see gap_single_client + +function tag.object.set_gap_mult_client(t, gap_mult_client) + tag.setproperty(t, "gap_mult_client", gap_mult_client == true) +end + +function tag.object.get_gap_mult_client(t) + local val = tag.getproperty(t, "gap_mult_client") + if val ~= nil then + return val + end + val = beautiful.gap_mult_client + if val ~= nil then + return val + end + return defaults.gap_mult_client +end + --- Get the spacing between clients. -- @deprecated awful.tag.getgap -- @see gap