From 25b3e718d1f7ddd029bdffde52248ebe04bae430 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 10 May 2009 16:41:28 +0200 Subject: [PATCH] wibox: do not set need_arrange on wibox detach Signed-off-by: Julien Danjou --- lib/awful/layout/init.lua.in | 40 +++++++++++++++++++++--------------- wibox.c | 2 -- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in index 60c27aef..b086b765 100644 --- a/lib/awful/layout/init.lua.in +++ b/lib/awful/layout/init.lua.in @@ -93,23 +93,29 @@ function getname(layout) end hooks.arrange.register(on_arrange) -hooks.property.register(function (c, prop) - if type(c) ~= "client" then return end - if prop == "size_hints_honor" - or prop == "struts" - or prop == "minimized" - or prop == "sticky" - or prop == "fullscreen" - or prop == "maximized_horizontal" - or prop == "maximized_vertical" - or prop == "border_width" - or prop == "hide" then - on_arrange(c.screen) - elseif prop == "screen" then - -- If prop is screen, we do not know what was the previous screen, so - -- let's arrange all screens :-( - for screen = 1, capi.screen.count() do - on_arrange(screen) +hooks.property.register(function (obj, prop) + local objtype = type(obj) + if objtype == "client" then + if prop == "size_hints_honor" + or prop == "struts" + or prop == "minimized" + or prop == "sticky" + or prop == "fullscreen" + or prop == "maximized_horizontal" + or prop == "maximized_vertical" + or prop == "border_width" + or prop == "hide" then + on_arrange(obj.screen) + elseif prop == "screen" then + -- If prop is screen, we do not know what was the previous screen, so + -- let's arrange all screens :-( + for screen = 1, capi.screen.count() do + on_arrange(screen) + end + end + elseif objtype == "wibox" then + if prop == "screen" then + on_arrange(obj.screen) end end end) diff --git a/wibox.c b/wibox.c index 69009c9e..fcba4eb2 100644 --- a/wibox.c +++ b/wibox.c @@ -386,8 +386,6 @@ wibox_detach(wibox_t *wibox) simplewindow_wipe(&wibox->sw); - wibox->screen->need_arrange = true; - foreach(item, globalconf.wiboxes) if(*item == wibox) {