mirror of
https://github.com/swaywm/sway.git
synced 2024-11-18 05:59:15 +00:00
Merge pull request #2506 from vilhalmer/ipc-get_tree-return-app_id-and-class
Add app_id and class to get_tree output
This commit is contained in:
commit
8232cbf00f
|
@ -5,6 +5,7 @@
|
||||||
#include "sway/config.h"
|
#include "sway/config.h"
|
||||||
#include "sway/ipc-json.h"
|
#include "sway/ipc-json.h"
|
||||||
#include "sway/tree/container.h"
|
#include "sway/tree/container.h"
|
||||||
|
#include "sway/tree/view.h"
|
||||||
#include "sway/tree/workspace.h"
|
#include "sway/tree/workspace.h"
|
||||||
#include "sway/output.h"
|
#include "sway/output.h"
|
||||||
#include "sway/input/input-manager.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);
|
c->name ? json_object_new_string(c->name) : NULL);
|
||||||
json_object_object_add(object, "type", json_object_new_string("con"));
|
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) {
|
if (c->parent) {
|
||||||
json_object_object_add(object, "layout",
|
json_object_object_add(object, "layout",
|
||||||
json_object_new_string(ipc_json_layout_description(c->layout)));
|
json_object_new_string(ipc_json_layout_description(c->layout)));
|
||||||
|
|
Loading…
Reference in a new issue