]> git.sur5r.net Git - i3/i3/blobdiff - src/ewmh.c
cmdparse: s/direction/split_direction to be more clear
[i3/i3] / src / ewmh.c
index a8bc51c8b976260e2278de7bc21bab1b8c6edf0b..7b2cc3e458fe03d754acae891d0ca48a61a72a20 100644 (file)
@@ -3,7 +3,7 @@
  *
  * i3 - an improved dynamic tiling window manager
  *
- * © 2009 Michael Stapelberg and contributors
+ * © 2009-2011 Michael Stapelberg and contributors
  *
  * See file LICENSE for license information.
  *
@@ -24,12 +24,14 @@ void ewmh_update_current_desktop() {
     Con *focused_ws = con_get_workspace(focused);
     Con *output;
     uint32_t idx = 0;
+    /* We count to get the index of this workspace because named workspaces
+     * don’t have the ->num property */
     TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
         Con *ws;
         TAILQ_FOREACH(ws, &(output_get_content(output)->nodes_head), nodes) {
             if (ws == focused_ws) {
                 xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
-                        atoms[_NET_CURRENT_DESKTOP], CARDINAL, 32, 1, &idx);
+                        A__NET_CURRENT_DESKTOP, A_CARDINAL, 32, 1, &idx);
                 return;
             }
             ++idx;
@@ -46,7 +48,7 @@ void ewmh_update_current_desktop() {
  */
 void ewmh_update_active_window(xcb_window_t window) {
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
-            atoms[_NET_ACTIVE_WINDOW], WINDOW, 32, 1, &window);
+            A__NET_ACTIVE_WINDOW, A_WINDOW, 32, 1, &window);
 }
 
 /*
@@ -102,7 +104,7 @@ void ewmh_update_workarea() {
         }
     }
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
-            atoms[_NET_WORKAREA], CARDINAL, 32,
+            A__NET_WORKAREA, A_CARDINAL, 32,
             num_workspaces * (sizeof(Rect) / sizeof(uint32_t)),
             workarea);
     free(workarea);