X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fewmh.c;h=7b2cc3e458fe03d754acae891d0ca48a61a72a20;hb=08f64f011d00da966b474d4f93f7f55b78387fb7;hp=a8bc51c8b976260e2278de7bc21bab1b8c6edf0b;hpb=c0563af3e27543d97eb3d201c2e197cc6285cb80;p=i3%2Fi3 diff --git a/src/ewmh.c b/src/ewmh.c index a8bc51c8..7b2cc3e4 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -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);