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 # Test for ticket #676: 'scratchpad show' causes a segfault if the scratchpad
18 # window is shown on another workspace.
21 use List::Util qw(first);
22 use X11::XCB qw(:all);
24 my $i3 = i3(get_socket_path());
25 my $tmp = fresh_workspace;
27 # TODO: move to X11::XCB
29 my ($id, $class, $instance) = @_;
31 # Add a _NET_WM_STRUT_PARTIAL hint
32 my $atomname = $x->atom(name => 'WM_CLASS');
33 my $atomtype = $x->atom(name => 'STRING');
41 length($class) + length($instance) + 2,
42 "$instance\x00$class\x00"
48 my $wm_class = delete($args{wm_class}) || 'special';
52 before_map => sub { set_wm_class($_->id, $wm_class, $wm_class) },
56 my $win = open_window;
58 my $scratch = open_special;
59 cmd '[class="special"] move scratchpad';
61 is_num_children($tmp, 1, 'one window on current ws');
63 my $otmp = fresh_workspace;
64 cmd 'scratchpad show';
67 cmd '[class="special"] scratchpad show';