diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-03-06 12:16:28 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-11 10:56:20 -0400 |
commit | 776d8d8d08284431d1c626d58287e0b699a55fbe (patch) | |
tree | fae50c3d7edde342be4350cdc197ad486d327112 /sway/ipc-json.c | |
parent | Fix container_parent_layout for scratchpad windows (diff) | |
download | sway-776d8d8d08284431d1c626d58287e0b699a55fbe.tar.gz sway-776d8d8d08284431d1c626d58287e0b699a55fbe.tar.zst sway-776d8d8d08284431d1c626d58287e0b699a55fbe.zip |
ipc: fix rect for stacked children
This now takes all titlebars for stacked children into account for the
ipc property `rect`
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 8 |
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) { | |||
535 | if (node->type == N_CONTAINER) { | 535 | if (node->type == N_CONTAINER) { |
536 | struct wlr_box deco_rect = {0, 0, 0, 0}; | 536 | struct wlr_box deco_rect = {0, 0, 0, 0}; |
537 | get_deco_rect(node->sway_container, &deco_rect); | 537 | get_deco_rect(node->sway_container, &deco_rect); |
538 | box.y += deco_rect.height; | 538 | size_t count = 1; |
539 | box.height -= deco_rect.height; | 539 | if (container_parent_layout(node->sway_container) == L_STACKED) { |
540 | count = container_get_siblings(node->sway_container)->length; | ||
541 | } | ||
542 | box.y += deco_rect.height * count; | ||
543 | box.height -= deco_rect.height * count; | ||
540 | } | 544 | } |
541 | 545 | ||
542 | json_object *focus = json_object_new_array(); | 546 | json_object *focus = json_object_new_array(); |