diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-03-06 12:16:28 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-06 10:49:32 -0700 |
commit | 8ada2daba5f58fe2bba77127bedd4e9af7c8844f (patch) | |
tree | 8299c35d9b01d958028deef312a5a6dc73c52853 | |
parent | Fix container_parent_layout for scratchpad windows (diff) | |
download | sway-8ada2daba5f58fe2bba77127bedd4e9af7c8844f.tar.gz sway-8ada2daba5f58fe2bba77127bedd4e9af7c8844f.tar.zst sway-8ada2daba5f58fe2bba77127bedd4e9af7c8844f.zip |
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.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(); |