ipc: implement events, cleanup the code a bit

This commit is contained in:
Michael Stapelberg
2010-03-12 21:05:05 +01:00
parent 69ed573422
commit 3db4890683
5 changed files with 192 additions and 57 deletions

View 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