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

@ -101,11 +101,19 @@ is_deeply(\@actual_names, \@expected_names);
# Kill first window to close a workspace.
cmd '[id="' . $second->id . '"] kill';
is(get_current_desktop, 2, '_NET_CURRENT_DESKTOP should be updated');
is(get_current_desktop, 1, '_NET_CURRENT_DESKTOP should be updated');
is(get_num_of_desktops, 2, '_NET_NUMBER_OF_DESKTOPS should be updated');
my @actual_names = get_desktop_names;
my @expected_names = ('0', '2');
is_deeply(\@actual_names, \@expected_names, '_NET_DESKTOP_NAMES should be updated');
# Rename workspace to reorder them.
cmd 'rename workspace 0 to 5';
is(get_current_desktop, 0, '_NET_CURRENT_DESKTOP should be updated');
is(get_num_of_desktops, 2, '_NET_NUMBER_OF_DESKTOPS should remain the same');
my @actual_names = get_desktop_names;
my @expected_names = ('2', '5');
is_deeply(\@actual_names, \@expected_names, '_NET_DESKTOP_NAMES should be updated');
done_testing;