Skip to main content
path: root/tests
diff options
authorEric Williams2018-03-28 19:55:38 +0000
committerEric Williams2018-04-16 19:27:06 +0000
commit7ac153d75bbe583d855662ea077c9ab158c18169 (patch)
treed5e38fb2fcb5f64690151bcf1dd70f85a5c39b4d /tests
parent802688f6202feab16b46f81f6e6b893c37341a30 (diff)
Bug 529431: [GTK3.10+] Snippet294 fails to draw Region
Fix input handling for GTK3.10+ setRegion behaviour. This does a manual check to see if the incoming event coordinates are within the set region: if they are, ignore them. This prevents events like SWT.Selection, SWT.Mouse[Up/Down], etc. from triggering when they are spawned from within the set region. There are two main limitations though: 1) we cannot stop native GTK events as we are doing the region drawing on the SWT level. This means things like mouse enter/leave, button pre-light, etc. will still be visible. We block the selection/click events at the SWT level, but unfortunately there is no reliable way to block these on the GTK level. 2) we also can't block all selection events, as some widgets are selectable using the keyboard (which has no coordinates). This means we could potentially block out selection events that *should* be sent. Tested on GTK3.22, no AllNonBrowser JUnit test failures. Change-Id: Ifd8377feb7d71a366edcdf6083d2bc94ab779886 Signed-off-by: Eric Williams <>
Diffstat (limited to 'tests')
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/
index 135afdc265..fab5f9bdf8 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/
@@ -86,8 +86,11 @@ public class Bug529431_SetRegionTesting {
// define the shape of the button using setRegion
- // Uncomment to test input handling
-// b2.addListener(SWT.Selection, e -> shell.close());
+ // test input handling
+ widget.addListener(SWT.Selection, e -> System.out.println("SWT.Selection sent"));
+ widget.addListener(SWT.MouseDown, e -> System.out.println("SWT.MouseDown sent"));
+ widget.addListener(SWT.MouseExit, e -> System.out.println("SWT.MouseExit sent"));
+ widget.addListener(SWT.MouseEnter, e -> System.out.println("SWT.MouseEnter sent"));

Back to the top