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 # Moves the last window of a workspace to the scratchpad. The workspace will be
18 # cleaned up and previously, the subsequent focusing of a destroyed container
21 # Bug still in: 4.4-97-gf767ac3
23 use X11::XCB qw(:all);
25 # TODO: move to X11::XCB
27 my ($id, $class, $instance) = @_;
29 # Add a _NET_WM_STRUT_PARTIAL hint
30 my $atomname = $x->atom(name => 'WM_CLASS');
31 my $atomtype = $x->atom(name => 'STRING');
39 length($class) + length($instance) + 2,
40 "$instance\x00$class\x00"
46 my $wm_class = delete($args{wm_class}) || 'special';
50 before_map => sub { set_wm_class($_->id, $wm_class, $wm_class) },
54 my $tmp = fresh_workspace;
56 # Open a new window which we can identify later on based on its WM_CLASS.
57 my $scratch = open_special;
59 my $tmp2 = fresh_workspace;
61 cmd '[class="special"] move scratchpad';