]> git.sur5r.net Git - i3/i3/blobdiff - src/workspace.c
ipc: also send workspace event when initializing a workspace for an output
[i3/i3] / src / workspace.c
index 7a9a959cb371c532d7e1d2ae46bf64313a1dcaa1..8d76272925ff8ff5b3d9eb754ffac2147d252072 100644 (file)
@@ -28,6 +28,7 @@
 #include "client.h"
 #include "log.h"
 #include "ewmh.h"
+#include "ipc.h"
 
 /*
  * Returns a pointer to the workspace with the given number (starting at 0),
@@ -57,6 +58,8 @@ Workspace *workspace_get(int number) {
                 workspace_set_name(ws, NULL);
 
                 TAILQ_INSERT_TAIL(workspaces, ws, workspaces);
+
+                ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"init\"}");
         }
         DLOG("done\n");
 
@@ -165,6 +168,8 @@ void workspace_show(xcb_connection_t *conn, int workspace) {
                         xcb_flush(conn);
                 }
 
+                ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");
+
                 return;
         }
 
@@ -178,6 +183,8 @@ void workspace_show(xcb_connection_t *conn, int workspace) {
         current_col = c_ws->current_col;
         DLOG("new current row = %d, current col = %d\n", current_row, current_col);
 
+        ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");
+
         workspace_map_clients(conn, c_ws);
 
         /* POTENTIAL TO IMPROVE HERE: due to the call to _map_clients first and
@@ -453,7 +460,8 @@ int workspace_height(Workspace *ws) {
                 height -= client->desired_height;
 
         /* Space for the internal bar */
-        height -= (font->height + 6);
+        if (!config.disable_workspace_bar)
+                height -= (font->height + 6);
 
         return height;
 }