From 92e21903007b3fdb7c02ecc76d763cc949bd6ec3 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 26 Dec 2012 22:02:43 +0100 Subject: [PATCH] t/503-workspace: sync after switching focus to a different output --- testcases/t/503-workspace.t | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/testcases/t/503-workspace.t b/testcases/t/503-workspace.t index 20d4fd2b..c79643e3 100644 --- a/testcases/t/503-workspace.t +++ b/testcases/t/503-workspace.t @@ -61,8 +61,18 @@ open_window; # output 2: 2 cmd 'workspace 1'; cmd 'workspace next'; +# We need to sync after changing focus to a different output to wait for the +# EnterNotify to be processed, otherwise it will be processed at some point +# later in time and mess up our subsequent tests. +sync_with_i3; + is(focused_ws, '2', 'workspace 2 focused'); cmd 'workspace next'; +# We need to sync after changing focus to a different output to wait for the +# EnterNotify to be processed, otherwise it will be processed at some point +# later in time and mess up our subsequent tests. +sync_with_i3; + is(focused_ws, '5', 'workspace 5 focused'); ################################################################################ @@ -81,11 +91,9 @@ cmd 'workspace prev_on_output'; is(focused_ws, '1', 'workspace 1 focused'); cmd 'workspace 2'; - -# XXX: This is to avoid EnterNotifies changing the focus. Not sure why they -# appear sometimes in the first place. Only happens when running the full -# testsuite. -$x->root->warp_pointer(1025, 0); +# We need to sync after changing focus to a different output to wait for the +# EnterNotify to be processed, otherwise it will be processed at some point +# later in time and mess up our subsequent tests. sync_with_i3; cmd 'workspace prev_on_output';