$window->map;
wait_for_map($window);
+
+ # MapWindow is sent before i3 even starts rendering: the window is placed at
+ # temporary off-screen coordinates first, and x_push_changes() sends further
+ # X11 requests to set focus etc. Hence, we sync with i3 before continuing.
+ sync_with_i3();
+
return $window;
}
$_sync_window = open_window(
rect => [ -15, -15, 10, 10 ],
override_redirect => 1,
+ dont_map => 1,
);
}
is($events[0]->{container}->{name}, $name, "$name focused");
}
-subtest 'focus left (1)', \&focus_subtest, 'focus left', 'Window 1';
-subtest 'focus left (2)', \&focus_subtest, 'focus left', 'Window 0';
-subtest 'focus right (1)', \&focus_subtest, 'focus right', 'Window 1';
-subtest 'focus right (2)', \&focus_subtest, 'focus right', 'Window 2';
-subtest 'focus right (3)', \&focus_subtest, 'focus right', 'Window 0';
-subtest 'focus left', \&focus_subtest, 'focus left', 'Window 2';
+subtest 'focus left (1)', \&focus_subtest, 'focus left', $win1->name;
+subtest 'focus left (2)', \&focus_subtest, 'focus left', $win0->name;
+subtest 'focus right (1)', \&focus_subtest, 'focus right', $win1->name;
+subtest 'focus right (2)', \&focus_subtest, 'focus right', $win2->name;
+subtest 'focus right (3)', \&focus_subtest, 'focus right', $win0->name;
+subtest 'focus left', \&focus_subtest, 'focus left', $win2->name;
done_testing;