visible == currently visible on the output it is on
(multiple workspaces can be visible at the same time)
focused == has the focus (only one workspace can be focused)
static void ipc_send_workspaces(int fd) {
Workspace *ws;
+ Client *last_focused = SLIST_FIRST(&(c_ws->focus_stack));
+ if (last_focused == SLIST_END(&(c_ws->focus_stack)))
+ last_focused = NULL;
+
yajl_gen gen = yajl_gen_alloc(NULL, NULL);
y(array_open);
ystr("name");
ystr(ws->utf8_name);
- ystr("active");
+ ystr("visible");
y(bool, ws->output->current_workspace == ws);
+ ystr("focused");
+ y(bool, (last_focused != NULL && last_focused->workspace == ws));
+
ystr("rect");
y(map_open);
ystr("x");