diff --git a/lib/awful/client.lua b/lib/awful/client.lua index 6241856e5..b6e0ef008 100644 --- a/lib/awful/client.lua +++ b/lib/awful/client.lua @@ -766,7 +766,7 @@ function client.idx(c) end local t = c.screen.selected_tag - local nmaster = t.nmaster + local nmaster = t.master_count -- This will happen for floating or maximized clients if not idx then return nil end diff --git a/lib/awful/layout/init.lua b/lib/awful/layout/init.lua index 43dd2344e..b1da60e6b 100644 --- a/lib/awful/layout/init.lua +++ b/lib/awful/layout/init.lua @@ -220,7 +220,7 @@ end capi.screen.add_signal("arrange") capi.tag.connect_signal("property::master_width_factor", arrange_tag) -capi.tag.connect_signal("property::nmaster", arrange_tag) +capi.tag.connect_signal("property::master_count", arrange_tag) capi.tag.connect_signal("property::column_count", arrange_tag) capi.tag.connect_signal("property::layout", arrange_tag) capi.tag.connect_signal("property::windowfact", arrange_tag) diff --git a/lib/awful/layout/suit/corner.lua b/lib/awful/layout/suit/corner.lua index 4b8c20712..2327186ae 100644 --- a/lib/awful/layout/suit/corner.lua +++ b/lib/awful/layout/suit/corner.lua @@ -30,7 +30,7 @@ local function do_corner(p, orientation) local column = {} local row = {} -- Use the nmaster field of the tag in a cheaty way - local row_privileged = ((cls[1].screen.selected_tag.nmaster % 2) == 0) + local row_privileged = ((cls[1].screen.selected_tag.master_count % 2) == 0) local master_factor = cls[1].screen.selected_tag.master_width_factor master.width = master_factor * wa.width diff --git a/lib/awful/layout/suit/tile.lua b/lib/awful/layout/suit/tile.lua index ae1ff9b3b..802fdce97 100644 --- a/lib/awful/layout/suit/tile.lua +++ b/lib/awful/layout/suit/tile.lua @@ -209,7 +209,7 @@ local function do_tile(param, orientation) local gs = param.geometries local cls = param.clients - local nmaster = math.min(t.nmaster, #cls) + local nmaster = math.min(t.master_count, #cls) local nother = math.max(#cls - nmaster,0) local mwfact = t.master_width_factor diff --git a/lib/awful/tag.lua b/lib/awful/tag.lua index 7391a2686..b892f0af1 100644 --- a/lib/awful/tag.lua +++ b/lib/awful/tag.lua @@ -535,7 +535,7 @@ end -- -- @property master_width_factor -- @param number Between 0 and 1 --- @see nmaster +-- @see master_count -- @see column_count -- @see master_fill_policy -- @see gap @@ -750,7 +750,7 @@ end -- -- **Signal:** -- --- * *property::gap* +-- * *property::useless_gap* -- -- @property gap -- @param number The value has to be greater than zero. @@ -863,45 +863,48 @@ end -- -- **Signal:** -- --- * *property::nmaster* +-- * *property::nmaster* (deprecated) +-- * *property::master_count* (deprecated) -- --- @property nmaster +-- @property master_count -- @param integer nmaster Only positive values are accepted -function tag.object.set_nmaster(t, nmaster) +function tag.object.set_master_count(t, nmaster) if nmaster >= 0 then tag.setproperty(t, "nmaster", nmaster) + tag.setproperty(t, "master_count", nmaster) end end -function tag.object.get_nmaster(t) - return tag.getproperty(t, "nmaster") or 1 +function tag.object.get_master_count(t) + return tag.getproperty(t, "master_count") or 1 end --- -- @deprecated awful.tag.setnmaster --- @see nmaster +-- @see master_count -- @param nmaster The number of master windows. -- @param[opt] t The tag. function tag.setnmaster(nmaster, t) - util.deprecate("Use t.nmaster = nmaster instead of awful.tag.setnmaster") + util.deprecate("Use t.master_count = nmaster instead of awful.tag.setnmaster") - tag.object.set_nmaster(t or ascreen.focused().selected_tag, nmaster) + tag.object.set_master_count(t or ascreen.focused().selected_tag, nmaster) end --- Get the number of master windows. -- @deprecated awful.tag.getnmaster --- @see nmaster +-- @see master_count -- @param[opt] t The tag. function tag.getnmaster(t) - util.deprecate("Use t.nmaster instead of awful.tag.setnmaster") + util.deprecate("Use t.master_count instead of awful.tag.setnmaster") t = t or ascreen.focused().selected_tag - return tag.getproperty(t, "nmaster") or 1 + return tag.getproperty(t, "master_count") or 1 end --- Increase the number of master windows. -- @function awful.tag.incnmaster +-- @see master_count -- @param add Value to add to number of master windows. -- @param[opt] t The tag to modify, if null tag.selected() is used. -- @tparam[opt=false] boolean sensible Limit nmaster based on the number of @@ -913,7 +916,7 @@ function tag.incnmaster(add, t, sensible) local screen = get_screen(tag.getproperty(t, "screen")) local ntiled = #screen.tiled_clients - local nmaster = tag.object.get_nmaster(t) + local nmaster = tag.object.get_master_count(t) if nmaster > ntiled then nmaster = ntiled end @@ -922,9 +925,9 @@ function tag.incnmaster(add, t, sensible) if newnmaster > ntiled then newnmaster = ntiled end - tag.object.set_nmaster(t, newnmaster) + tag.object.set_master_count(t, newnmaster) else - tag.object.set_nmaster(t, tag.object.get_nmaster(t) + add) + tag.object.set_master_count(t, tag.object.get_master_count(t) + add) end end @@ -1021,7 +1024,7 @@ function tag.incncol(add, t, sensible) if sensible then local screen = get_screen(tag.getproperty(t, "screen")) local ntiled = #screen.tiled_clients - local nmaster = tag.object.get_nmaster(t) + local nmaster = tag.object.get_master_count(t) local nsecondary = ntiled - nmaster local ncol = tag.object.get_column_count(t) @@ -1318,6 +1321,7 @@ capi.tag.add_signal("property::master_fill_policy") capi.tag.add_signal("property::ncol") capi.tag.add_signal("property::column_count") capi.tag.add_signal("property::nmaster") +capi.tag.add_signal("property::master_count") capi.tag.add_signal("property::windowfact") capi.tag.add_signal("property::screen") capi.tag.add_signal("property::index") diff --git a/tests/examples/shims/tag.lua b/tests/examples/shims/tag.lua index de3a5f357..e8fd463e4 100644 --- a/tests/examples/shims/tag.lua +++ b/tests/examples/shims/tag.lua @@ -13,6 +13,7 @@ local function new_tag(_, args) ret:add_signal("property::mwfact") ret:add_signal("property::ncol") ret:add_signal("property::column_count") + ret:add_signal("property::master_count") ret:add_signal("property::nmaster") ret:add_signal("property::index") ret:add_signal("property::useless_gap") diff --git a/tests/test-awesomerc.lua b/tests/test-awesomerc.lua index 75cc07737..012fda0da 100644 --- a/tests/test-awesomerc.lua +++ b/tests/test-awesomerc.lua @@ -93,8 +93,8 @@ function() assert(t.master_width_factor == 0.55) - -- Now, test the nmaster - assert(t.nmaster == 1) + -- Now, test the master_count + assert(t.master_count == 1) get_callback({modkey, "Shift"}, "h")() @@ -105,7 +105,7 @@ end, function() local _, t = get_c_and_t() - assert(t.nmaster == 2) + assert(t.master_count == 2) -- Now, test the column_count assert(t.column_count == 1)