From 5475ad49f3c86eb488f9eff6b0ffc3073a7df834 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Thu, 17 Dec 2015 18:12:14 -0500 Subject: [PATCH] Fix main shell not active using Xvfb 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 Reviewed-on: https://git.eclipse.org/r/62979 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse --- .../tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java index 208b4b7db1..1e4b3051d1 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java @@ -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 -- 2.34.1