From: Michael Stapelberg Date: Fri, 12 Mar 2010 02:01:34 +0000 (+0100) Subject: ipc: change active to visible, introduce focused X-Git-Tag: 3.e~6^2~92 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9ed5e00107f97c59d7b4c6461ab9de32b7815b7a;p=i3%2Fi3 ipc: change active to visible, introduce focused 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) --- diff --git a/src/ipc.c b/src/ipc.c index 0df379b4..20e41219 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -101,6 +101,10 @@ static void ipc_send_message(int fd, const unsigned char *payload, 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); @@ -115,9 +119,12 @@ static void ipc_send_workspaces(int fd) { 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");