2 # vim:ts=4:sw=4:expandtab
4 # Test for ticket #676: 'scratchpad show' causes a segfault if the scratchpad
5 # window is shown on another workspace.
8 use List::Util qw(first);
11 my $i3 = i3(get_socket_path());
12 my $tmp = fresh_workspace;
14 # TODO: move to X11::XCB
16 my ($id, $class, $instance) = @_;
18 # Add a _NET_WM_STRUT_PARTIAL hint
19 my $atomname = $x->atom(name => 'WM_CLASS');
20 my $atomtype = $x->atom(name => 'STRING');
28 length($class) + length($instance) + 2,
29 "$instance\x00$class\x00"
35 my $wm_class = delete($args{wm_class}) || 'special';
39 before_map => sub { set_wm_class($_->id, $wm_class, $wm_class) },
43 my $win = open_window;
45 my $scratch = open_special;
46 cmd '[class="special"] move scratchpad';
48 my ($nodes, $focus) = get_ws_content($tmp);
49 is(scalar @$nodes, 1, 'one window on current ws');
51 my $otmp = fresh_workspace;
52 cmd 'scratchpad show';
55 cmd '[class="special"] scratchpad show';