diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-08-25 13:06:04 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-25 13:06:04 +1000 |
commit | 4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9 (patch) | |
tree | f1ed7e866d4e34f5ef9b8f72ec8095369619aaa7 /sway/ipc-json.c | |
parent | f51b9478f28143a4f1887711497ff131f26ab1c4 (diff) | |
parent | e86d99acd655815781cd2e23877ce58ab5b24826 (diff) |
Merge branch 'master' into commands
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index f40af043..06cb7e11 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -5,6 +5,7 @@ #include "sway/config.h" #include "sway/ipc-json.h" #include "sway/tree/container.h" +#include "sway/tree/view.h" #include "sway/tree/workspace.h" #include "sway/output.h" #include "sway/input/input-manager.h" @@ -192,6 +193,16 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object c->name ? json_object_new_string(c->name) : NULL); json_object_object_add(object, "type", json_object_new_string("con")); + if (c->type == C_VIEW) { + const char *app_id = view_get_app_id(c->sway_view); + json_object_object_add(object, "app_id", + app_id ? json_object_new_string(app_id) : NULL); + + const char *class = view_get_class(c->sway_view); + json_object_object_add(object, "class", + class ? json_object_new_string(class) : NULL); + } + if (c->parent) { json_object_object_add(object, "layout", json_object_new_string(ipc_json_layout_description(c->layout))); |