Fix main shell not active using Xvfb
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 17 Dec 2015 23:12:14 +0000 (18:12 -0500)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Fri, 18 Dec 2015 18:54:10 +0000 (13:54 -0500)
There seems to be problems on some system where the main shell is not in
focus initially. This was seen using Xvfb and Xephyr on some occasions.

Change-Id: Ib6dda93e856deb96cf865dce6253b48c99171184
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/62979
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java

index 208b4b7db14f4278117f80bd352a938304cbfbb3..1e4b3051d11f1a061fa7ade60b5c819495d92ff3 100644 (file)
@@ -262,6 +262,11 @@ public final class SWTBotUtils {
 
         SWTWorkbenchBot bot = new SWTWorkbenchBot();
         UIThreadRunnable.syncExec(() -> {
+
+            // There seems to be problems on some system where the main shell is
+            // not in focus initially. This was seen using Xvfb and Xephyr on some occasions.
+            focusMainWindow(bot.shells());
+
             Shell shell = bot.activeShell().widget;
 
             // Only adjust shell if it appears to be the top-most
This page took 0.027392 seconds and 5 git commands to generate.