Client: Only emit property::{x,y,width,height} if necessary

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-03-11 17:16:32 +01:00
parent eff4474c6d
commit b6baca5857
1 changed files with 9 additions and 5 deletions

View File

@ -573,6 +573,7 @@ client_resize(client_t *c, area_t geometry)
send_notice = true; send_notice = true;
/* Also store geometry including border */ /* Also store geometry including border */
area_t old_geometry = c->geometry;
c->geometry = geometry; c->geometry = geometry;
/* Ignore all spurious enter/leave notify events */ /* Ignore all spurious enter/leave notify events */
@ -595,11 +596,14 @@ client_resize(client_t *c, area_t geometry)
luaA_object_push(globalconf.L, c); luaA_object_push(globalconf.L, c);
luaA_object_emit_signal(globalconf.L, -1, "property::geometry", 0); luaA_object_emit_signal(globalconf.L, -1, "property::geometry", 0);
/** \todo This need to be VERIFIED before it is emitted! */ if (old_geometry.x != geometry.x)
luaA_object_emit_signal(globalconf.L, -1, "property::x", 0); luaA_object_emit_signal(globalconf.L, -1, "property::x", 0);
luaA_object_emit_signal(globalconf.L, -1, "property::y", 0); if (old_geometry.y != geometry.y)
luaA_object_emit_signal(globalconf.L, -1, "property::width", 0); luaA_object_emit_signal(globalconf.L, -1, "property::y", 0);
luaA_object_emit_signal(globalconf.L, -1, "property::height", 0); if (old_geometry.width != geometry.width)
luaA_object_emit_signal(globalconf.L, -1, "property::width", 0);
if (old_geometry.height != geometry.height)
luaA_object_emit_signal(globalconf.L, -1, "property::height", 0);
lua_pop(globalconf.L, 1); lua_pop(globalconf.L, 1);
return true; return true;