Call all ewmh_update_* functions together when necessary

The testcase is changed because it was actually incorrect. Easy to
verify because:
> _NET_CURRENT_DESKTOP
> …
> The index of the current desktop. This is always an integer between 0
> and _NET_NUMBER_OF_DESKTOPS - 1.

Fixes #3696.
Also updates the viewports.

Finally, fixes an issue with _NET_CURRENT_DESKTOP not being updated
after a workspace rename. Example:
- workspaces 1, 2, 3
- rename workspace 1 to 5
- All workspaces changed their index but _NET_CURRENT_DESKTOP was not
updated
This commit is contained in:
Orestis Floros
2019-05-03 15:46:38 +03:00
parent 830465b39f
commit c9efa6dffe
7 changed files with 35 additions and 40 deletions

View File

@ -11,6 +11,12 @@
#include <config.h>
/**
* Updates all the EWMH desktop properties.
*
*/
void ewmh_update_desktop_properties(void);
/**
* Updates _NET_CURRENT_DESKTOP with the current desktop number.
*
@ -20,24 +26,6 @@
*/
void ewmh_update_current_desktop(void);
/**
* Updates _NET_NUMBER_OF_DESKTOPS which we interpret as the number of
* noninternal workspaces.
*/
void ewmh_update_number_of_desktops(void);
/**
* Updates _NET_DESKTOP_NAMES: "The names of all virtual desktops. This is a
* list of NULL-terminated strings in UTF-8 encoding"
*/
void ewmh_update_desktop_names(void);
/**
* Updates _NET_DESKTOP_VIEWPORT, which is an array of pairs of cardinals that
* define the top left corner of each desktop's viewport.
*/
void ewmh_update_desktop_viewport(void);
/**
* Updates _NET_WM_DESKTOP for all windows.
* A request will only be made if the cached value differs from the calculated value.