Blame SOURCES/jdk8234107-mouse_wheel_test_fix.patch

0b657e
# HG changeset patch
0b657e
# User neugens
0b657e
# Date 1573806470 -3600
0b657e
#      Fri Nov 15 09:27:50 2019 +0100
0b657e
# Node ID 88ddd6943a061dcd0103755ee829e1e7838cb224
0b657e
# Parent  b5cdba232fcaf77d02ef06a6b18dcfd3518d948e
0b657e
8234107: Several AWT modal dialog tests failing on Linux after JDK-8231991
0b657e
Summary: Fix off by one in wheel detection logic
0b657e
Reviewed-by: prr
0b657e
0b657e
diff --git a/src/solaris/classes/sun/awt/X11/XBaseWindow.java b/src/solaris/classes/sun/awt/X11/XBaseWindow.java
0b657e
--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java
0b657e
+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java
0b657e
@@ -1032,8 +1032,8 @@
0b657e
         int buttonState = 0;
0b657e
         buttonState = xbe.get_state() & XConstants.ALL_BUTTONS_MASK;
0b657e
 
0b657e
-        boolean isWheel = (theButton != XConstants.MouseWheelUp ||
0b657e
-                           theButton != XConstants.MouseWheelDown);
0b657e
+        boolean isWheel = (theButton == XConstants.MouseWheelUp ||
0b657e
+                           theButton == XConstants.MouseWheelDown);
0b657e
 
0b657e
         // don't give focus if it's just the mouse wheel turning
0b657e
         if (!isWheel) {
0b657e
diff --git openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XConstants.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
0b657e
--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
0b657e
+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
0b657e
@@ -208,8 +208,8 @@
0b657e
 
0b657e
     // those should probably be wrapped in a method or such
0b657e
     // as it may be possible to remap them via x11 configuration files
0b657e
-    public static final int MouseWheelUp = buttons[4];
0b657e
-    public static final int MouseWheelDown = buttons[5];
0b657e
+    public static final int MouseWheelUp = buttons[3];
0b657e
+    public static final int MouseWheelDown = buttons[4];
0b657e
 
0b657e
     /* Notify modes */
0b657e