49 | 49 |
return unpack ("L$len", $reply->{value});
|
50 | 50 |
}
|
51 | 51 |
|
52 | |
# initialize the workspaces
|
|
52 |
################################################################################
|
|
53 |
# Initialize the workspaces
|
|
54 |
################################################################################
|
|
55 |
|
53 | 56 |
cmd 'workspace 1';
|
54 | 57 |
cmd 'workspace 0';
|
55 | 58 |
|
|
58 | 61 |
|
59 | 62 |
is_deeply(\@desktop_viewport, \@expected_viewport,
|
60 | 63 |
'_NET_DESKTOP_VIEWPORT should be an array of x/y coordinate pairs for the upper left corner of the respective outputs of the workspaces');
|
|
64 |
|
|
65 |
################################################################################
|
|
66 |
# Create workspace
|
|
67 |
################################################################################
|
61 | 68 |
|
62 | 69 |
cmd 'workspace 0';
|
63 | 70 |
open_window;
|
|
69 | 76 |
is_deeply(\@desktop_viewport, \@expected_viewport,
|
70 | 77 |
'it should be updated when a new workspace appears');
|
71 | 78 |
|
|
79 |
################################################################################
|
|
80 |
# Rename workspace
|
|
81 |
################################################################################
|
|
82 |
|
72 | 83 |
cmd 'rename workspace 3 to 2';
|
73 | 84 |
|
74 | 85 |
@expected_viewport = (0, 0, 0, 0, 1024, 0);
|
|
76 | 87 |
|
77 | 88 |
is_deeply(\@desktop_viewport, \@expected_viewport,
|
78 | 89 |
'it should stay up to date when a workspace is renamed');
|
|
90 |
|
|
91 |
################################################################################
|
|
92 |
# Empty workspace
|
|
93 |
################################################################################
|
79 | 94 |
|
80 | 95 |
cmd 'workspace 0';
|
81 | 96 |
|
|
85 | 100 |
is_deeply(\@desktop_viewport, \@expected_viewport,
|
86 | 101 |
'it should be updated when a workspace is emptied');
|
87 | 102 |
|
|
103 |
################################################################################
|
|
104 |
# Move workspace
|
|
105 |
# See #4001
|
|
106 |
################################################################################
|
|
107 |
|
|
108 |
# Keep workspace 1 open to have 3 workspaces in total
|
|
109 |
cmd 'workspace 1';
|
|
110 |
open_window;
|
|
111 |
cmd 'workspace 0, move workspace to output right';
|
|
112 |
@expected_viewport = (0, 0, 1024, 0, 1024, 0);
|
|
113 |
@desktop_viewport = get_desktop_viewport;
|
|
114 |
is_deeply(\@desktop_viewport, \@expected_viewport,
|
|
115 |
'it should be updated when a workspace is moved');
|
|
116 |
|
|
117 |
################################################################################
|
|
118 |
|
88 | 119 |
done_testing;
|