diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in index d8b36060f..c07524f97 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 2602017e5..89ff09160 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.