aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-03-06 12:16:28 -0500
committerFurkan Sahin <furkan-dev@proton.me>2019-03-06 12:16:28 -0500
commitbdf2448651d147932e1753a663bb62f8a0e39598 (patch)
tree8299c35d9b01d958028deef312a5a6dc73c52853
parent25df336746244a798200a13d07fbe5183f6f0a11 (diff)
ipc: fix rect for stacked children
This now takes all titlebars for stacked children into account for the ipc property `rect`
-rw-r--r--sway/ipc-json.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index c008f241..bcc525ad 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -535,8 +535,12 @@ json_object *ipc_json_describe_node(struct sway_node *node) {
if (node->type == N_CONTAINER) {
struct wlr_box deco_rect = {0, 0, 0, 0};
get_deco_rect(node->sway_container, &deco_rect);
- box.y += deco_rect.height;
- box.height -= deco_rect.height;
+ size_t count = 1;
+ if (container_parent_layout(node->sway_container) == L_STACKED) {
+ count = container_get_siblings(node->sway_container)->length;
+ }
+ box.y += deco_rect.height * count;
+ box.height -= deco_rect.height * count;
}
json_object *focus = json_object_new_array();