]> git.sur5r.net Git - i3/i3/commitdiff
ipc: send a workspace event when the urgency flag changes
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 20 Mar 2010 02:09:42 +0000 (03:09 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 20 Mar 2010 02:09:42 +0000 (03:09 +0100)
docs/ipc
src/workspace.c

index 5d70d7fe40bd57126330eda42f80bd6946ae5549..117050a315538c9a402ef93ac92da958195f4bb0 100644 (file)
--- a/docs/ipc
+++ b/docs/ipc
@@ -268,7 +268,7 @@ output::
 
 This event consists of a single serialized map containing a property
 +change (string)+ which indicates the type of the change ("focus", "init",
 
 This event consists of a single serialized map containing a property
 +change (string)+ which indicates the type of the change ("focus", "init",
-"empty").
+"empty", "urgent").
 
 *Example:*
 ---------------------
 
 *Example:*
 ---------------------
index 8d76272925ff8ff5b3d9eb754ffac2147d252072..67874f2910f139a1641256c058311db57d5ffae5 100644 (file)
@@ -425,16 +425,21 @@ void workspace_unmap_clients(xcb_connection_t *conn, Workspace *u_ws) {
  */
 void workspace_update_urgent_flag(Workspace *ws) {
         Client *current;
  */
 void workspace_update_urgent_flag(Workspace *ws) {
         Client *current;
+        bool old_flag = ws->urgent;
+        bool urgent = false;
 
         SLIST_FOREACH(current, &(ws->focus_stack), focus_clients) {
                 if (!current->urgent)
                         continue;
 
 
         SLIST_FOREACH(current, &(ws->focus_stack), focus_clients) {
                 if (!current->urgent)
                         continue;
 
-                ws->urgent = true;
-                return;
+                urgent = true;
+                break;
         }
 
         }
 
-        ws->urgent = false;
+        ws->urgent = urgent;
+
+        if (old_flag != urgent)
+                ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"urgent\"}");
 }
 
 /*
 }
 
 /*