object/client.c: added position and size properties

added client signals connection

added comments doc
This commit is contained in:
Luke Bonham 2017-01-30 13:42:54 +01:00 committed by Emmanuel Lepage Vallee
parent cc5c4147d9
commit ff47b0d0c4
2 changed files with 28 additions and 10 deletions

View File

@ -85,8 +85,8 @@ end
capi.client.connect_signal("property::shape_client_bounding", shape.update.bounding)
capi.client.connect_signal("property::shape_client_clip", shape.update.clip)
capi.client.connect_signal("property::width", shape.update.all)
capi.client.connect_signal("property::height", shape.update.all)
capi.client.connect_signal("property::size", shape.update.all)
capi.client.connect_signal("property::border_width", shape.update.all)
return shape

View File

@ -733,6 +733,16 @@
* @param tag
*/
/** When the height or width changed.
* @signal property::size
* @see client.geometry
*/
/** When the x or y coordinate changed.
* @signal property::position
* @see client.geometry
*/
/**
* The border color when the client is focused.
*
@ -1647,14 +1657,22 @@ client_resize_do(client_t *c, area_t geometry)
luaA_object_push(L, c);
if (!AREA_EQUAL(old_geometry, geometry))
luaA_object_emit_signal(L, -1, "property::geometry", 0);
if (old_geometry.x != geometry.x)
luaA_object_emit_signal(L, -1, "property::x", 0);
if (old_geometry.y != geometry.y)
luaA_object_emit_signal(L, -1, "property::y", 0);
if (old_geometry.width != geometry.width)
luaA_object_emit_signal(L, -1, "property::width", 0);
if (old_geometry.height != geometry.height)
luaA_object_emit_signal(L, -1, "property::height", 0);
if (old_geometry.x != geometry.x || old_geometry.y != geometry.y)
{
luaA_object_emit_signal(L, -1, "property::position", 0);
if (old_geometry.x != geometry.x)
luaA_object_emit_signal(L, -1, "property::x", 0);
else
luaA_object_emit_signal(L, -1, "property::y", 0);
}
if (old_geometry.width != geometry.width || old_geometry.height != geometry.height)
{
luaA_object_emit_signal(L, -1, "property::size", 0);
if (old_geometry.width != geometry.width)
luaA_object_emit_signal(L, -1, "property::width", 0);
else
luaA_object_emit_signal(L, -1, "property::height", 0);
}
lua_pop(L, 1);
screen_client_moveto(c, new_screen, false);