Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Williams2019-03-15 17:41:28 +0000
committerEric Williams2019-03-15 19:09:18 +0000
commit503289d0caf86406cbac61cd86030cd7d18ec4d8 (patch)
tree676128344b7fff6f202fbfb876bc957e482147cb /tests
parent43234122f502f709237b72a329b42036a27582db (diff)
downloadeclipse.platform.swt-503289d0caf86406cbac61cd86030cd7d18ec4d8.tar.gz
eclipse.platform.swt-503289d0caf86406cbac61cd86030cd7d18ec4d8.tar.xz
eclipse.platform.swt-503289d0caf86406cbac61cd86030cd7d18ec4d8.zip
Bug 545403: [GTK3] MouseWheel event only reports GDK.GDK_SCROLL_UP
gdk_event_get_scroll_direction() will return false if GDK_SMOOTH is enabled. The fix is to check if this function returns false, and then call gdk_event_get_scroll_deltas() to get the scroll delta. Change-Id: I27bb15b61d9da4c5e749e71d6bb27bbcfc63b879 Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug545403_ScrollDirection.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug545403_ScrollDirection.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug545403_ScrollDirection.java
new file mode 100644
index 0000000000..718ead0126
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug545403_ScrollDirection.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Red Hat and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Red Hat - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class Bug545403_ScrollDirection {
+
+ public static void main(String[] args) {
+ final Display display = new Display();
+
+ final Shell shell = new Shell(display);
+ shell.addListener(SWT.MouseWheel, event -> System.out.println(event.count));
+
+ shell.setSize(300, 200);
+ shell.open();
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+
+ display.dispose();
+ }
+} \ No newline at end of file

Back to the top