Skip to content

Commit

Permalink
swaymsg: pretty-print sandbox properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmcnamee committed Jan 4, 2025
1 parent ef25285 commit 270600d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions swaymsg/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(")");
}

Expand Down

0 comments on commit 270600d

Please sign in to comment.