2 # vim:ts=4:sw=4:expandtab
3 # Beware that this test uses workspace 9 to perform some tests (it expects
4 # the workspace to be empty).
5 # TODO: skip it by default?
9 use Time::HiRes qw(sleep);
12 use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
16 skip "Testcase not yet modified for new move concept", 7;
18 my $x = X11::XCB::Connection->new;
22 # Switch to the nineth workspace
23 $i3->command('9')->recv;
25 #####################################################################
26 # Create two windows and make sure focus switching works
27 #####################################################################
29 my $top = i3test::open_standard_window($x);
31 my $mid = i3test::open_standard_window($x);
33 my $bottom = i3test::open_standard_window($x);
36 diag("top id = " . $top->id);
37 diag("mid id = " . $mid->id);
38 diag("bottom id = " . $bottom->id);
41 # Returns the input focus after sending the given command to i3 via IPC
42 # end sleeping for half a second to make sure i3 reacted
47 $i3->command($msg)->recv;
48 return $x->input_focus;
51 my $focus = $x->input_focus;
52 is($focus, $bottom->id, "Latest window focused");
54 $focus = focus_after("ml");
55 is($focus, $bottom->id, "Right window still focused");
57 $focus = focus_after("h");
58 is($focus, $mid->id, "Middle window focused");
60 #####################################################################
61 # Now move to the top window, move right, then move left again
62 # (e.g., does i3 remember the focus in the last container?)
63 #####################################################################
65 $focus = focus_after("k");
66 is($focus, $top->id, "Top window focused");
68 $focus = focus_after("l");
69 is($focus, $bottom->id, "Right window focused");
71 $focus = focus_after("h");
72 is($focus, $top->id, "Top window focused");
74 #####################################################################
75 # Move window cross-workspace
76 #####################################################################
78 for my $cmd (qw(m12 t m13 12 13)) {
79 $i3->command($cmd)->recv;
81 ok(1, "Still living");