summaryrefslogtreecommitdiff
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorlbonn <[email protected]>2017-10-08 02:24:08 +0200
committerlbonn <[email protected]>2017-10-08 11:54:46 +0200
commit61005c3bdab54b2ee84365fed4894c0e34da6c5b (patch)
tree8550777f6cffe2f692831b5edb77c45c2867adc5 /sway/ipc-server.c
parentb2d4caf6c34d8b6f6eccb9872a7d95772be19c10 (diff)
ipc/window-event: fill "container" on close events
Also use the recursive description to include children as well Careful: send the event before deleting the parent
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 26d0be65..9122d548 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -792,11 +792,7 @@ void ipc_event_window(swayc_t *window, const char *change) {
sway_log(L_DEBUG, "Sending window::%s event", change);
json_object *obj = json_object_new_object();
json_object_object_add(obj, "change", json_object_new_string(change));
- if (strcmp(change, "close") == 0 || !window) {
- json_object_object_add(obj, "container", NULL);
- } else {
- json_object_object_add(obj, "container", ipc_json_describe_container(window));
- }
+ json_object_object_add(obj, "container", ipc_json_describe_container_recursive(window));
const char *json_string = json_object_to_json_string(obj);
ipc_send_event(json_string, IPC_EVENT_WINDOW);