diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 142512eb2..d3adedd4e 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "config.h" #include "log.h" @@ -577,6 +578,10 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object json_object_object_add(object, "app_id", app_id ? json_object_new_string(app_id) : NULL); + json_object_object_add(object, "foreign_toplevel_identifier", + c->view->ext_foreign_toplevel ? + json_object_new_string(c->view->ext_foreign_toplevel->identifier) : NULL); + bool visible = view_is_visible(c->view); json_object_object_add(object, "visible", json_object_new_boolean(visible)); diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd index f39e35180..ab85cf66c 100644 --- a/sway/sway-ipc.7.scd +++ b/sway/sway-ipc.7.scd @@ -389,6 +389,9 @@ node and will have the following properties: |- pid : integer : (Only views) The PID of the application that owns the view +|- foreign_toplevel_identifier +: string +: (Only views) The ext-foreign-toplevel-list-v1 toplevel identifier of this node. |- visible : boolean : (Only views) Whether the node is visible diff --git a/swaymsg/main.c b/swaymsg/main.c index 0ef6eb8a5..7534ea6db 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -330,6 +330,7 @@ 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 *foreign_toplevel_id = json_object_get_string(json_object_object_get(obj, "foreign_toplevel_identifier")); 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")); @@ -347,6 +348,9 @@ static void pretty_print_tree(json_object *obj, int indent) { if (x11_id != 0) { printf(", X11 window: 0x%X", x11_id); } + if (foreign_toplevel_id != NULL) { + printf(", foreign_toplevel_id: \"%s\"", foreign_toplevel_id); + } if (sandbox_engine != NULL) { printf(", sandbox_engine: \"%s\"", sandbox_engine); }