Blob Blame History Raw
# HG changeset patch
# User neugens
# Date 1573806470 -3600
#      Fri Nov 15 09:27:50 2019 +0100
# Node ID 88ddd6943a061dcd0103755ee829e1e7838cb224
# Parent  b5cdba232fcaf77d02ef06a6b18dcfd3518d948e
8234107: Several AWT modal dialog tests failing on Linux after JDK-8231991
Summary: Fix off by one in wheel detection logic
Reviewed-by: prr

diff --git a/src/solaris/classes/sun/awt/X11/XBaseWindow.java b/src/solaris/classes/sun/awt/X11/XBaseWindow.java
--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java
+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java
@@ -1032,8 +1032,8 @@
         int buttonState = 0;
         buttonState = xbe.get_state() & XConstants.ALL_BUTTONS_MASK;
 
-        boolean isWheel = (theButton != XConstants.MouseWheelUp ||
-                           theButton != XConstants.MouseWheelDown);
+        boolean isWheel = (theButton == XConstants.MouseWheelUp ||
+                           theButton == XConstants.MouseWheelDown);
 
         // don't give focus if it's just the mouse wheel turning
         if (!isWheel) {
diff --git openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XConstants.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XConstants.java
@@ -208,8 +208,8 @@
 
     // those should probably be wrapped in a method or such
     // as it may be possible to remap them via x11 configuration files
-    public static final int MouseWheelUp = buttons[4];
-    public static final int MouseWheelDown = buttons[5];
+    public static final int MouseWheelUp = buttons[3];
+    public static final int MouseWheelDown = buttons[4];
 
     /* Notify modes */