Add each view's shell to JSON description

This is a criteria you can use to select windows since commit
484cc189e9 ("Add shell criteria token"), but there's no way to query
it for an existing window. This exposes its value in the output of
`swaymsg -t get_tree`.
master
Thomas Hebb 5 years ago committed by Brian Ashworth
parent 58703e4f24
commit f18bcfcd69

@ -493,6 +493,8 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object
json_object_object_add(object, "max_render_time", json_object_new_int(c->view->max_render_time)); json_object_object_add(object, "max_render_time", json_object_new_int(c->view->max_render_time));
json_object_object_add(object, "shell", json_object_new_string(view_get_shell(c->view)));
#if HAVE_XWAYLAND #if HAVE_XWAYLAND
if (c->view->type == SWAY_VIEW_XWAYLAND) { if (c->view->type == SWAY_VIEW_XWAYLAND) {
json_object_object_add(object, "window", json_object_object_add(object, "window",

@ -376,6 +376,9 @@ node and will have the following properties:
|- visible |- visible
: boolean : boolean
: (Only views) Whether the node is visible : (Only views) Whether the node is visible
|- shell
: string
: (Only views) The shell of the view, such as _xdg\_shell_ or _xwayland_
|- window |- window
: integer : integer
: (Only xwayland views) The X11 window ID for the xwayland view : (Only xwayland views) The X11 window ID for the xwayland view
@ -672,6 +675,7 @@ node and will have the following properties:
"pid": 23959, "pid": 23959,
"app_id": null, "app_id": null,
"visible": true, "visible": true,
"shell": "xwayland",
"window_properties": { "window_properties": {
"class": "URxvt", "class": "URxvt",
"instance": "urxvt", "instance": "urxvt",
@ -726,6 +730,7 @@ node and will have the following properties:
"pid": 25370, "pid": 25370,
"app_id": "termite", "app_id": "termite",
"visible": true, "visible": true,
"shell": "xdg_shell",
"nodes": [ "nodes": [
] ]
} }

Loading…
Cancel
Save