swaymsg: pretty-print sandbox properties

This commit is contained in:
Jacob McNamee 2025-01-04 00:03:14 -08:00 committed by Simon Ser
parent f177d05441
commit 0b08dce08c

View file

@ -330,6 +330,9 @@ static void pretty_print_tree(json_object *obj, int indent) {
const char *instance = json_object_get_string(json_object_object_get(window_props_obj, "instance"));
const char *class = json_object_get_string(json_object_object_get(window_props_obj, "class"));
int x11_id = json_object_get_int(json_object_object_get(obj, "window"));
const char *sandbox_engine = json_object_get_string(json_object_object_get(obj, "sandbox_engine"));
const char *sandbox_app_id = json_object_get_string(json_object_object_get(obj, "sandbox_app_id"));
const char *sandbox_instance_id = json_object_get_string(json_object_object_get(obj, "sandbox_instance_id"));
printf(" (%s, pid: %d", shell, pid);
if (app_id != NULL) {
@ -344,6 +347,15 @@ static void pretty_print_tree(json_object *obj, int indent) {
if (x11_id != 0) {
printf(", X11 window: 0x%X", x11_id);
}
if (sandbox_engine != NULL) {
printf(", sandbox_engine: \"%s\"", sandbox_engine);
}
if (sandbox_app_id != NULL) {
printf(", sandbox_app_id: \"%s\"", sandbox_app_id);
}
if (sandbox_instance_id != NULL) {
printf(", sandbox_instance_id: \"%s\"", sandbox_instance_id);
}
printf(")");
}