Fixes for maximized clients

When a client is maximized and then has a titlebar added / removed, we need some
special magic to make sure it still gets the correct geometry. This is now done
by maximizing the client again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-08-17 20:52:32 +02:00
parent 6d1130b408
commit 5fafe8d0eb
1 changed files with 22 additions and 0 deletions

View File

@ -191,6 +191,22 @@ titlebar_geometry_compute(client_t *c, area_t geometry, area_t *res)
} }
} }
static void
workaround_broken_titlebars(client_t *c)
{
/* Ugly hack to fix #610 */
if(c->maximized_horizontal)
{
c->maximized_horizontal = false;
client_set_maximized_horizontal(globalconf.L, -1, true);
}
if(c->maximized_vertical)
{
c->maximized_vertical = false;
client_set_maximized_vertical(globalconf.L, -1, true);
}
}
/** Detach a wibox titlebar from its client. /** Detach a wibox titlebar from its client.
* \param c The client. * \param c The client.
*/ */
@ -212,6 +228,9 @@ titlebar_client_detach(client_t *c)
hook_property(c, "titlebar"); hook_property(c, "titlebar");
luaA_object_push(globalconf.L, c); luaA_object_push(globalconf.L, c);
luaA_object_emit_signal(globalconf.L, -1, "property::titlebar", 0); luaA_object_emit_signal(globalconf.L, -1, "property::titlebar", 0);
workaround_broken_titlebars(c);
lua_pop(globalconf.L, 1); lua_pop(globalconf.L, 1);
client_stack(); client_stack();
} }
@ -275,6 +294,9 @@ titlebar_client_attach(client_t *c)
luaA_object_push(globalconf.L, c); luaA_object_push(globalconf.L, c);
luaA_object_emit_signal(globalconf.L, -1, "property::titlebar", 0); luaA_object_emit_signal(globalconf.L, -1, "property::titlebar", 0);
workaround_broken_titlebars(c);
lua_pop(globalconf.L, 1); lua_pop(globalconf.L, 1);
client_stack(); client_stack();
} }