Set EWMH desktop properties on startup.

Calls ewmh_update_current_desktop on startup to set the
_NET_CURRENT_DESKTOP property. Without this change the property only
gets set after the workspaces have been manipulated. Also exclude
hidden workspaces (i.e. those starting with "__" from the workspace
index.

Adds tests for startup and workspace switching.
This commit is contained in:
Steve Jones
2014-02-01 16:09:51 +00:00
committed by Michael Stapelberg
parent 905440d6d1
commit 0e27ff3cd0
3 changed files with 81 additions and 0 deletions

View File

@ -27,6 +27,9 @@ void ewmh_update_current_desktop(void) {
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
Con *ws;
TAILQ_FOREACH(ws, &(output_get_content(output)->nodes_head), nodes) {
if (STARTS_WITH(ws->name, "__"))
continue;
if (ws == focused_ws) {
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
A__NET_CURRENT_DESKTOP, XCB_ATOM_CARDINAL, 32, 1, &idx);