From 851889f2b7ce2f0884a67997347f94966389c6ea Mon Sep 17 00:00:00 2001 From: Gregor Best Date: Wed, 7 Oct 2009 02:20:39 +0200 Subject: [PATCH] awful.screen: fix padding Signed-off-by: Gregor Best Signed-off-by: Julien Danjou --- lib/awful/layout/init.lua.in | 6 ++++-- lib/awful/screen.lua.in | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in index a50cf9169..963582e4e 100644 --- a/lib/awful/layout/init.lua.in +++ b/lib/awful/layout/init.lua.in @@ -71,7 +71,7 @@ function arrange(screen) local p = {} p.workarea = capi.screen[screen].workarea -- Handle padding - local padding = ascreen.padding(screen) + local padding = ascreen.padding(capi.screen[screen]) if padding then p.workarea.x = p.workarea.x + (padding.left or 0) p.workarea.y = p.workarea.y + (padding.top or 0) @@ -140,7 +140,9 @@ for s = 1, capi.screen.count() do capi.screen[s]:add_signal("tag::detach", function (screen, tag) arrange(screen.index) end) - capi.screen[s]:add_signal("padding", arrange) + capi.screen[s]:add_signal("padding", function (screen) + arrange(screen.index) + end) end capi.client.add_signal("focus", function(c) arrange(c.screen) end) diff --git a/lib/awful/screen.lua.in b/lib/awful/screen.lua.in index 8f6049d07..0ca10fd34 100644 --- a/lib/awful/screen.lua.in +++ b/lib/awful/screen.lua.in @@ -39,15 +39,15 @@ function focus_relative(i) end --- Get or set the screen padding. --- @param i The screen number. +-- @param screen The screen object to change the padding on -- @param padding The padding, an table with 'top', 'left', 'right' and/or -- 'bottom'. Can be nil if you only want to retrieve padding -function padding(i, padding) +function padding(screen, padding) if padding then - data.padding[i] = padding - capi.screen[i]:emit_signal("padding") + data.padding[screen] = padding + screen:emit_signal("padding") end - return data.padding[i] + return data.padding[screen] end -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80