2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Tests for _NET_WM_DESKTOP.
19 use i3test i3_autostart => 0;
20 use X11::XCB qw(:all);
22 sub get_net_wm_desktop {
26 my $cookie = $x->get_property(
29 $x->atom(name => '_NET_WM_DESKTOP')->id,
30 $x->atom(name => 'CARDINAL')->id,
35 my $reply = $x->get_property_reply($cookie->{sequence});
36 return undef if $reply->{length} != 1;
38 return unpack("L", $reply->{value});
43 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
45 workspace "0" output "fake-0"
46 workspace "1" output "fake-0"
47 workspace "2" output "fake-0"
48 workspace "10" output "fake-1"
49 workspace "11" output "fake-1"
50 workspace "12" output "fake-1"
52 fake-outputs 1024x768+0+0,1024x768+1024+0
55 ###############################################################################
56 # _NET_WM_DESKTOP is updated when the window is moved to another workspace
58 ###############################################################################
60 my $pid = launch_with_config($config);
67 my $con = open_window;
69 cmd 'move window to workspace 10';
71 is(get_net_wm_desktop($con), 1, '_NET_WM_DESKTOP is updated when moving the window');
73 exit_gracefully($pid);