From e4ff32f580a2b0637d7f48b53d0ebb2028e808bf Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Fri, 29 Aug 2014 15:27:29 +0400 Subject: [PATCH] 6624085: Fourth mouse button (wheel) is treated like second button - isPopupTrigger returns true Reviewed-by: anthony, azvegint --- .../unix/classes/sun/awt/X11/XWindow.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java index 49384a9e54e..9bb7c3cc2fb 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java @@ -55,7 +55,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { */ private final static int AWT_MULTICLICK_SMUDGE = 4; // ButtonXXX events stuff - static int rbutton = 0; static int lastX = 0, lastY = 0; static long lastTime = 0; static long lastButton = 0; @@ -632,23 +631,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { return res; } - /** - * Returns true if this event is disabled and shouldn't be passed to Java. - * Default implementation returns false for all events. - */ - static int getRightButtonNumber() { - if (rbutton == 0) { // not initialized yet - XToolkit.awtLock(); - try { - rbutton = XlibWrapper.XGetPointerMapping(XToolkit.getDisplay(), XlibWrapper.ibuffer, 3); - } - finally { - XToolkit.awtUnlock(); - } - } - return rbutton; - } - static int getMouseMovementSmudge() { //TODO: It's possible to read corresponding settings return AWT_MULTICLICK_SMUDGE; @@ -716,11 +698,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { /* Check for popup trigger !! */ - if (lbutton == getRightButtonNumber() || lbutton > 2) { - popupTrigger = true; - } else { - popupTrigger = false; - } + popupTrigger = (lbutton == 3); } button = XConstants.buttons[lbutton - 1];