2 # vim:ts=4:sw=4:expandtab
3 # Regression: Check if the focus stays the same when switching the layout
4 # bug introduced by 77d0d42ed2d7ac8cafe267c92b35a81c1b9491eb
7 use Time::HiRes qw(sleep);
10 use_ok('X11::XCB::Window');
13 my $i3 = i3(get_socket_path());
14 my $x = X11::XCB::Connection->new;
19 my @ws = @{$i3->get_workspaces->recv};
20 my @nums = map { $_->{num} } grep { defined($_->{num}) } @ws;
21 my @sorted = sort @nums;
23 cmp_deeply(\@nums, \@sorted, $msg);
26 my $tmp = fresh_workspace;
28 my $left = open_standard_window($x);
30 my $mid = open_standard_window($x);
32 my $right = open_standard_window($x);
35 diag("left = " . $left->id . ", mid = " . $mid->id . ", right = " . $right->id);
37 is($x->input_focus, $right->id, 'Right window focused');
41 is($x->input_focus, $mid->id, 'Mid window focused');
45 is($x->input_focus, $mid->id, 'Mid window focused');