screen: client move triggers property hooks, no need_arrange

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-04-17 23:54:08 +02:00
parent d62b75679a
commit f9f5b2068b
2 changed files with 12 additions and 6 deletions

View file

@ -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)

View file

@ -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.