aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar vilhalmer <vil@vil.lv>2018-08-21 20:51:01 -0400
committerLibravatar vilhalmer <vil@vil.lv>2018-08-21 20:51:01 -0400
commit03718aaebb519bb38282395023306d980d70d459 (patch)
tree68176def99b41bce0b97c0f75847eabd00b6fb70 /sway/ipc-json.c
parentMerge pull request #2505 from RyanDwyer/fix-set-fullscreen (diff)
downloadsway-03718aaebb519bb38282395023306d980d70d459.tar.gz
sway-03718aaebb519bb38282395023306d980d70d459.tar.zst
sway-03718aaebb519bb38282395023306d980d70d459.zip
Add app_id and class to get_tree output
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c11
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 @@
5#include "sway/config.h" 5#include "sway/config.h"
6#include "sway/ipc-json.h" 6#include "sway/ipc-json.h"
7#include "sway/tree/container.h" 7#include "sway/tree/container.h"
8#include "sway/tree/view.h"
8#include "sway/tree/workspace.h" 9#include "sway/tree/workspace.h"
9#include "sway/output.h" 10#include "sway/output.h"
10#include "sway/input/input-manager.h" 11#include "sway/input/input-manager.h"
@@ -192,6 +193,16 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object
192 c->name ? json_object_new_string(c->name) : NULL); 193 c->name ? json_object_new_string(c->name) : NULL);
193 json_object_object_add(object, "type", json_object_new_string("con")); 194 json_object_object_add(object, "type", json_object_new_string("con"));
194 195
196 if (c->type == C_VIEW) {
197 const char *app_id = view_get_app_id(c->sway_view);
198 json_object_object_add(object, "app_id",
199 app_id ? json_object_new_string(app_id) : NULL);
200
201 const char *class = view_get_class(c->sway_view);
202 json_object_object_add(object, "class",
203 class ? json_object_new_string(class) : NULL);
204 }
205
195 if (c->parent) { 206 if (c->parent) {
196 json_object_object_add(object, "layout", 207 json_object_object_add(object, "layout",
197 json_object_new_string(ipc_json_layout_description(c->layout))); 208 json_object_new_string(ipc_json_layout_description(c->layout)));