Implement EWMH number of desktops property

_NET_NUMBER_OF_DESKTOPS:

> This property SHOULD be set and updated by the Window Manager to
> indicate the number of virtual desktops.

We interpret this property as the number of noninternal workspaces.
This commit is contained in:
Tony Crisci
2014-06-16 02:50:47 -04:00
committed by Michael Stapelberg
parent 4c06e7a573
commit b47f480728
5 changed files with 33 additions and 2 deletions

View File

@ -92,6 +92,7 @@ Con *workspace_get(const char *num, bool *created) {
con_attach(workspace, content, false);
ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"init\"}");
ewmh_update_number_of_desktops();
if (created != NULL)
*created = true;
} else if (created != NULL) {
@ -424,6 +425,7 @@ static void _workspace_show(Con *workspace) {
LOG("Closing old workspace (%p / %s), it is empty\n", old, old->name);
tree_close(old, DONT_KILL_WINDOW, false, false);
ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"empty\"}");
ewmh_update_number_of_desktops();
}
}