diff options
author | Xi Yan | 2018-08-21 14:18:49 +0000 |
---|---|---|
committer | Xi Yan | 2018-09-18 14:44:36 +0000 |
commit | ae69be6c3c1008e9517e8550424a0fd0d34b866d (patch) | |
tree | bdb094f38f6ead04f88cded4160c2974e9a46ee8 /tests | |
parent | 444ff993205fdd816ea745b4b63ead6b307caf93 (diff) | |
download | eclipse.platform.swt-ae69be6c3c1008e9517e8550424a0fd0d34b866d.tar.gz eclipse.platform.swt-ae69be6c3c1008e9517e8550424a0fd0d34b866d.tar.xz eclipse.platform.swt-ae69be6c3c1008e9517e8550424a0fd0d34b866d.zip |
Bug 436841 - [GTK3] FocusOut/In and Activate/Deactivate events when
opening context menu
Added regression test to ensure Activate events are send.
Change-Id: I7d3aef73e14a86acd6f5edd544979a9c73b47741
Signed-off-by: Xi Yan <xixiyan@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java index ce64935a5e..21e20a044b 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java @@ -32,6 +32,7 @@ import org.eclipse.swt.events.ShellListener; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.graphics.Region; +import org.eclipse.swt.internal.gtk.OS; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; @@ -668,6 +669,29 @@ public void test_setBoundsLorg_eclipse_swt_graphics_Rectangle() { } /** + * Regression test for Bug 436841 - [GTK3] FocusOut/In and Activate/Deactivate + * events when opening context menu. Only applicable on GTK x11. + */ +@Test +public void test_activateEventSend() { + if (SwtTestUtil.isGTK && OS.isX11()) { + Shell testShell = new Shell(shell, SWT.SHELL_TRIM); + testShell.addListener(SWT.Activate, e -> { + listenerCalled = true; + }); + testShell.open(); + int[] styles = {SWT.ON_TOP, SWT.APPLICATION_MODAL, SWT.PRIMARY_MODAL, SWT.SYSTEM_MODAL, SWT.NO_TRIM, SWT.BORDER, SWT.SHELL_TRIM}; + for (int i = 0; i < styles.length; i++) { + Shell childShell = new Shell(testShell, styles[i]); + listenerCalled = false; + childShell.open(); + childShell.dispose(); + assertTrue(listenerCalled); + } + } +} + +/** * Regression test for Bug 445900: [GTK] Shell#computeTrim(..) wrong for * first invisible shell (editor hovers jump when enriched) */ |