Merge pull request #1513 from Elv13/merge_copycat

object/client.c: added position and size properties
This commit is contained in:
Emmanuel Lepage Vallée 2017-02-02 13:29:42 -05:00 committed by GitHub
commit 5439c34723
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 || 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);
if (old_geometry.y != geometry.y)
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);
if (old_geometry.height != geometry.height)
else
luaA_object_emit_signal(L, -1, "property::height", 0);
}
lua_pop(L, 1);
screen_client_moveto(c, new_screen, false);