From f2328e799e15b245d68a12e82457578020a9a89e Mon Sep 17 00:00:00 2001 From: neugens Date: Fri, 15 Nov 2019 09:27:50 +0100 Subject: [PATCH] 8234107: Several AWT modal dialog tests failing on Linux after JDK-8231991 Summary: Fix off by one in wheel detection logic Reviewed-by: prr --- src/solaris/classes/sun/awt/X11/XBaseWindow.java | 4 ++-- src/solaris/classes/sun/awt/X11/XConstants.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solaris/classes/sun/awt/X11/XBaseWindow.java b/src/solaris/classes/sun/awt/X11/XBaseWindow.java index 303d51b79..0569fc098 100644 --- a/src/solaris/classes/sun/awt/X11/XBaseWindow.java +++ b/src/solaris/classes/sun/awt/X11/XBaseWindow.java @@ -1011,8 +1011,8 @@ public class XBaseWindow { 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 a/src/solaris/classes/sun/awt/X11/XConstants.java b/src/solaris/classes/sun/awt/X11/XConstants.java index 341321741..264a6beb4 100644 --- a/src/solaris/classes/sun/awt/X11/XConstants.java +++ b/src/solaris/classes/sun/awt/X11/XConstants.java @@ -208,8 +208,8 @@ final public class XConstants { // 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 */ -- GitLab