changeset 9964:781526c39ed4

6624085: Fourth mouse button (wheel) is treated like second button - isPopupTrigger returns true Reviewed-by: anthony, azvegint Contributed-by: Alex Henrie <alexhenrie24@gmail.com>
author alexsch
date Wed, 03 Sep 2014 17:25:53 +0400
parents 2c9ddd836d5f
children 6e1c85a0b6cf
files src/solaris/classes/sun/awt/X11/XWindow.java
diffstat 1 files changed, 1 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XWindow.java	Tue Sep 02 14:39:15 2014 -0700
+++ b/src/solaris/classes/sun/awt/X11/XWindow.java	Wed Sep 03 17:25:53 2014 +0400
@@ -55,7 +55,6 @@
    */
     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 @@
         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 @@
             /*
                Check for popup trigger !!
             */
-            if (lbutton == getRightButtonNumber() || lbutton > 2) {
-                popupTrigger = true;
-            } else {
-                popupTrigger = false;
-            }
+            popupTrigger = (lbutton == 3);
         }
 
         button = XConstants.buttons[lbutton - 1];