Skip to content

Commit 7c9a790

Browse files
committed
Process events until parent shell is activated
It may take some event cycles before the parent shell that is getting focus/activation back gets the notification. Therefore wait until the Activate listener is called
1 parent 5ff6bc2 commit 7c9a790

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ public void test_setBoundsLorg_eclipse_swt_graphics_Rectangle() {
653653
* events when opening context menu. Only applicable on GTK x11.
654654
*/
655655
@Test
656-
public void test_activateEventSend() {
656+
public void test_activateEventSend() throws InterruptedException {
657657
if (SwtTestUtil.isGTK && SwtTestUtil.isX11) {
658658
Shell testShell = new Shell(shell, SWT.SHELL_TRIM);
659659
testShell.addListener(SWT.Activate, e -> {
@@ -666,6 +666,7 @@ public void test_activateEventSend() {
666666
listenerCalled = false;
667667
childShell.open();
668668
childShell.dispose();
669+
SwtTestUtil.processEvents(1000, () -> listenerCalled);
669670
assertTrue(listenerCalled);
670671
}
671672
}

0 commit comments

Comments
 (0)