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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-06-18 11:08:06 +02:00
parent 0c393c8f39
commit 7b65f068a1
1 changed files with 4 additions and 4 deletions

View File

@ -762,10 +762,10 @@ client_set_fullscreen(lua_State *L, int cidx, bool s)
} }
int abs_cidx = luaA_absindex(L, cidx); \ int abs_cidx = luaA_absindex(L, cidx); \
lua_pushboolean(L, s); lua_pushboolean(L, s);
luaA_object_emit_signal(L, abs_cidx, "request::fullscreen", 1);
c->fullscreen = s; 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); 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) \ if(s) \
client_set_fullscreen(L, abs_cidx, false); \ client_set_fullscreen(L, abs_cidx, false); \
lua_pushboolean(L, s); \ lua_pushboolean(L, s); \
luaA_object_emit_signal(L, abs_cidx, "request::maximized_" #type, 1); \
c->maximized_##type = s; \ 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); \ luaA_object_emit_signal(L, abs_cidx, "property::maximized_" #type, 0); \
stack_windows(); \
} \ } \
} }
DO_FUNCTION_CLIENT_MAXIMIZED(vertical) DO_FUNCTION_CLIENT_MAXIMIZED(vertical)