tests: add sync_with_i3 after open_window

We need to set dont_map => 1 on the sync window to prevent an endless loop.

Further, t/219-ipc-window-focus.t made assumptions about windows being named
incrementally, and that assumption is broken by the sync window opened by the
first sync_with_i3 call from open_window, so use the more reliable ->name.
This commit is contained in:
Michael Stapelberg
2017-10-03 09:58:10 +02:00
parent 4f751610c2
commit 5d55f93eb3
2 changed files with 13 additions and 6 deletions

View File

@ -350,6 +350,12 @@ sub open_window {
$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;
}
@ -688,6 +694,7 @@ sub sync_with_i3 {
$_sync_window = open_window(
rect => [ -15, -15, 10, 10 ],
override_redirect => 1,
dont_map => 1,
);
}