From ed67eaca2c310a34754dec5310a989e22df992fd Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Fri, 10 Apr 2020 04:37:41 +0200 Subject: Update EWMH properties on workspace move Closes #3965 Fixes #4001 --- src/workspace.c | 2 ++ testcases/t/521-ewmh-desktop-viewport.t | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/workspace.c b/src/workspace.c index b98750ff..f48599c7 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -1049,6 +1049,8 @@ void workspace_move_to_output(Con *ws, Output *output) { workspace_show(ws); } + ewmh_update_desktop_properties(); + if (!previously_visible_ws) { return; } diff --git a/testcases/t/521-ewmh-desktop-viewport.t b/testcases/t/521-ewmh-desktop-viewport.t index 5ede140d..a4119367 100644 --- a/testcases/t/521-ewmh-desktop-viewport.t +++ b/testcases/t/521-ewmh-desktop-viewport.t @@ -50,7 +50,10 @@ sub get_desktop_viewport { return unpack ("L$len", $reply->{value}); } -# initialize the workspaces +################################################################################ +# Initialize the workspaces +################################################################################ + cmd 'workspace 1'; cmd 'workspace 0'; @@ -60,6 +63,10 @@ my @desktop_viewport = get_desktop_viewport; is_deeply(\@desktop_viewport, \@expected_viewport, '_NET_DESKTOP_VIEWPORT should be an array of x/y coordinate pairs for the upper left corner of the respective outputs of the workspaces'); +################################################################################ +# Create workspace +################################################################################ + cmd 'workspace 0'; open_window; cmd 'workspace 3'; @@ -70,6 +77,10 @@ cmd 'workspace 3'; is_deeply(\@desktop_viewport, \@expected_viewport, 'it should be updated when a new workspace appears'); +################################################################################ +# Rename workspace +################################################################################ + cmd 'rename workspace 3 to 2'; @expected_viewport = (0, 0, 0, 0, 1024, 0); @@ -78,6 +89,10 @@ cmd 'rename workspace 3 to 2'; is_deeply(\@desktop_viewport, \@expected_viewport, 'it should stay up to date when a workspace is renamed'); +################################################################################ +# Empty workspace +################################################################################ + cmd 'workspace 0'; @expected_viewport = (0, 0, 1024, 0); @@ -86,4 +101,20 @@ cmd 'workspace 0'; is_deeply(\@desktop_viewport, \@expected_viewport, 'it should be updated when a workspace is emptied'); +################################################################################ +# Move workspace +# See #4001 +################################################################################ + +# Keep workspace 1 open to have 3 workspaces in total +cmd 'workspace 1'; +open_window; +cmd 'workspace 0, move workspace to output right'; +@expected_viewport = (0, 0, 1024, 0, 1024, 0); +@desktop_viewport = get_desktop_viewport; +is_deeply(\@desktop_viewport, \@expected_viewport, + 'it should be updated when a workspace is moved'); + +################################################################################ + done_testing; -- cgit v1.2.3-54-g00ecf