From e7c94708f24e3a173acbb28e6d3d79884e5c2b12 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sun, 26 Aug 2018 10:54:27 +0100 Subject: [PATCH 1/2] ipc: emit window close event earlier, before destroying --- sway/tree/container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/tree/container.c b/sway/tree/container.c index f13e2e96..6520c176 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -146,10 +146,10 @@ void container_begin_destroy(struct sway_container *con) { return; } - wl_signal_emit(&con->events.destroy, con); if (con->type == C_VIEW) { ipc_event_window(con, "close"); } + wl_signal_emit(&con->events.destroy, con); container_end_mouse_operation(con); From 6ae2e3a4a80df054cb6d5ad164a28a0094bced1d Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sun, 26 Aug 2018 11:01:54 +0100 Subject: [PATCH 2/2] ipc: clean-up container_create_notify function --- sway/tree/container.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sway/tree/container.c b/sway/tree/container.c index 6520c176..58fd4898 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -42,14 +42,12 @@ const char *container_type_to_str(enum sway_container_type type) { } void container_create_notify(struct sway_container *container) { - // TODO send ipc event type based on the container type - wl_signal_emit(&root_container.sway_root->events.new_container, container); - if (container->type == C_VIEW) { ipc_event_window(container, "new"); } else if (container->type == C_WORKSPACE) { ipc_event_workspace(NULL, container, "init"); } + wl_signal_emit(&root_container.sway_root->events.new_container, container); } void container_update_textures_recursive(struct sway_container *con) {