]> git.sur5r.net Git - i3/i3/blobdiff - src/con.c
Merge branch 'master' into next
[i3/i3] / src / con.c
index 3293a9fd89f940cad06144d5d7f2553b8f362c95..38ea0585e17f0887e178d0304f04ea6153a62e85 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -12,6 +12,7 @@
  *
  */
 #include "all.h"
+#include "yajl_utils.h"
 
 static void con_on_remove_child(Con *con);
 
@@ -1435,8 +1436,15 @@ static void con_on_remove_child(Con *con) {
     if (con->type == CT_WORKSPACE) {
         if (TAILQ_EMPTY(&(con->focus_head)) && !workspace_is_visible(con)) {
             LOG("Closing old workspace (%p / %s), it is empty\n", con, con->name);
+            yajl_gen gen = ipc_marshal_workspace_event("empty", con, NULL);
             tree_close(con, DONT_KILL_WINDOW, false, false);
-            ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"empty\"}");
+
+            const unsigned char *payload;
+            ylength length;
+            y(get_buf, &payload, &length);
+            ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, (const char *)payload);
+
+            y(free);
         }
         return;
     }