From f9f5b2068b23c7c9de06edf06155e9897f59f43e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 17 Apr 2009 23:54:08 +0200 Subject: [PATCH] screen: client move triggers property hooks, no need_arrange Signed-off-by: Julien Danjou --- lib/awful/layout/init.lua.in | 9 ++++++++- screen.c | 9 ++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in index d8b36060..c07524f9 100644 --- a/lib/awful/layout/init.lua.in +++ b/lib/awful/layout/init.lua.in @@ -94,7 +94,8 @@ end hooks.arrange.register(on_arrange) hooks.property.register(function (c, prop) - if type(c) == "client" and prop == "size_hints_honor" + if type(c) ~= "client" then return end + if prop == "size_hints_honor" or prop == "struts" or prop == "minimized" or prop == "sticky" @@ -104,6 +105,12 @@ hooks.property.register(function (c, prop) 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) + end end end) hooks.wibox_position.register(function(wibox) diff --git a/screen.c b/screen.c index 2602017e..89ff0916 100644 --- a/screen.c +++ b/screen.c @@ -240,7 +240,6 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool dotag, bool doresiz tag_array_t *old_tags = &old_screen->tags, *new_tags = &new_screen->tags; area_t from, to; - bool wasvisible = client_isvisible(c, c->screen); if(new_screen == c->screen) return; @@ -265,12 +264,11 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool dotag, bool doresiz } } - if(wasvisible) - old_screen->need_arrange = true; - client_need_arrange(c); - if(!doresize) + { + hook_property(client, c, "screen"); return; + } from = screen_area_get(old_screen, false); to = screen_area_get(c->screen, false); @@ -318,6 +316,7 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool dotag, bool doresiz } /* move / resize the client */ client_resize(c, new_geometry, false); + hook_property(client, c, "screen"); } /** Screen module.