aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/handlers.c3
-rw-r--r--sway/ipc-server.c6
2 files changed, 3 insertions, 6 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 4a2298cd..db0c5e24 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -557,6 +557,8 @@ static void handle_view_destroyed(wlc_handle handle) {
parent->fullscreen = NULL;
}
+ ipc_event_window(parent, "close");
+
// Destroy empty workspaces
if (parent->type == C_WORKSPACE &&
parent->children->length == 0 &&
@@ -567,7 +569,6 @@ static void handle_view_destroyed(wlc_handle handle) {
}
arrange_windows(parent, -1, -1);
- ipc_event_window(parent, "close");
} else {
// Is it unmanaged?
int i;
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);