From 7b65f068a1a2929cf330e3729dd8ebc7bab18fcc Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 18 Jun 2010 11:08:06 +0200 Subject: [PATCH] Reorder some code for fullscreening windows When one sets a client to fullscreen, this is what currently happens: - lua code: c.fullscreen = true - The C code emits request::fullscreen without having touched the client's fullscreen property yet (c.fullscreen is still false) - awful.ewmh changes the client's geometry to fullscreen via c:geometry() - This causes property::geometry to be emitted - awful.layout reacts on this and causes the screen to be re-arranged, undoing the fullscreen geometry set in awful.ewmh - The C code for c.fullscreen = true continues and actually changes the client's fullscreen flag The result of this is that we get a client which thinks it is fullscreen'd without actually being that. Fix this by first changing the client's fullscreen property and then emitting request::fullscreen. Same thing for maximized_{vertical,horizontal}. Thanks to Jim Pryor for reporting this bug and helping reproducing it. Signed-off-by: Uli Schlachter --- objects/client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/objects/client.c b/objects/client.c index 79dce8fdb..af01c0115 100644 --- a/objects/client.c +++ b/objects/client.c @@ -762,10 +762,10 @@ client_set_fullscreen(lua_State *L, int cidx, bool s) } int abs_cidx = luaA_absindex(L, cidx); \ lua_pushboolean(L, s); - luaA_object_emit_signal(L, abs_cidx, "request::fullscreen", 1); c->fullscreen = s; - stack_windows(); + luaA_object_emit_signal(L, abs_cidx, "request::fullscreen", 1); luaA_object_emit_signal(L, abs_cidx, "property::fullscreen", 0); + stack_windows(); } } @@ -785,10 +785,10 @@ client_set_fullscreen(lua_State *L, int cidx, bool s) if(s) \ client_set_fullscreen(L, abs_cidx, false); \ lua_pushboolean(L, s); \ - luaA_object_emit_signal(L, abs_cidx, "request::maximized_" #type, 1); \ c->maximized_##type = s; \ - stack_windows(); \ + luaA_object_emit_signal(L, abs_cidx, "request::maximized_" #type, 1); \ luaA_object_emit_signal(L, abs_cidx, "property::maximized_" #type, 0); \ + stack_windows(); \ } \ } DO_FUNCTION_CLIENT_MAXIMIZED(vertical)