From a6ae34d003e82e884fcc33495ff6acdcf9ae2bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Sat, 11 Aug 2012 23:55:25 +0200 Subject: [PATCH] Add awful.client.setmaster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function is the counterpart of awful.client.setslave. Windows is moved to the first position in the stack. Signed-off-by: Sébastien Luttringer Signed-off-by: Uli Schlachter --- lib/awful/client.lua.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index a8044e62..6586b1a9 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -410,6 +410,15 @@ function client.getmaster(screen) return client.visible(s)[1] end +--- Set the client as master: put it at the beginning of other windows. +-- @param c The window to set as master. +function client.setmaster(c) + local cls = util.table.reverse(capi.client.get(c.screen)) + for k, v in pairs(cls) do + c:swap(v) + end +end + --- Set the client as slave: put it at the end of other windows. -- @param c The window to set as slave. function client.setslave(c)