From 848a6fdb21473bfaec32de4a546b79ab53843771 Mon Sep 17 00:00:00 2001 From: lbonn Date: Fri, 22 May 2020 00:19:48 +0200 Subject: ipc: show marks of containers without view in tree --- sway/ipc-json.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 46c52156..67f0eed7 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -471,14 +471,6 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object bool visible = view_is_visible(c->view); json_object_object_add(object, "visible", json_object_new_boolean(visible)); - json_object *marks = json_object_new_array(); - list_t *con_marks = c->marks; - for (int i = 0; i < con_marks->length; ++i) { - json_object_array_add(marks, json_object_new_string(con_marks->items[i])); - } - - json_object_object_add(object, "marks", marks); - struct wlr_box window_box = { c->content_x - c->x, (c->current.border == B_PIXEL) ? c->current.border_thickness : 0, @@ -582,6 +574,14 @@ static void ipc_json_describe_container(struct sway_container *c, json_object *o get_deco_rect(c, &deco_box); json_object_object_add(object, "deco_rect", ipc_json_create_rect(&deco_box)); + json_object *marks = json_object_new_array(); + list_t *con_marks = c->marks; + for (int i = 0; i < con_marks->length; ++i) { + json_object_array_add(marks, json_object_new_string(con_marks->items[i])); + } + + json_object_object_add(object, "marks", marks); + if (c->view) { ipc_json_describe_view(c, object); } -- cgit v1.2.3-54-g00ecf