Merge
authorlana
Tue, 20 Apr 2010 16:48:56 -0700
changeset 5279 9031df3e55a7
parent 5276 3c1c9fda17a1 (current diff)
parent 5278 b387fb13bda1 (diff)
child 5287 4114baee5fe9
Merge
--- a/jdk/src/share/classes/java/awt/Component.java	Tue Apr 20 16:47:22 2010 -0700
+++ b/jdk/src/share/classes/java/awt/Component.java	Tue Apr 20 16:48:56 2010 -0700
@@ -4941,9 +4941,13 @@
                 // If we dispatch the event to toplevel ancestor,
                 // this could encolse the loop: 6480024.
                 anc.dispatchEventToSelf(newMWE);
-            }
-        }
-        return true;
+                if (newMWE.isConsumed()) {
+                    e.consume();
+                }
+                return true;
+            }
+        }
+        return false;
     }
 
     boolean checkWindowClosingException() {
--- a/jdk/src/share/classes/java/awt/Container.java	Tue Apr 20 16:47:22 2010 -0700
+++ b/jdk/src/share/classes/java/awt/Container.java	Tue Apr 20 16:48:56 2010 -0700
@@ -4492,7 +4492,10 @@
             retargetMouseEvent(mouseOver, id, e);
         break;
             }
-            e.consume();
+            //Consuming of wheel events is implemented in "retargetMouseEvent".
+            if (id != MouseEvent.MOUSE_WHEEL) {
+                e.consume();
+            }
     }
     return e.isConsumed();
     }
@@ -4800,6 +4803,12 @@
                     target.dispatchEvent(retargeted);
                 }
             }
+            if (id == MouseEvent.MOUSE_WHEEL && retargeted.isConsumed()) {
+                //An exception for wheel bubbling to the native system.
+                //In "processMouseEvent" total event consuming for wheel events is skipped.
+                //Protection from bubbling of Java-accepted wheel events.
+                e.consume();
+            }
         }
     }
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Tue Apr 20 16:47:22 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Tue Apr 20 16:48:56 2010 -0700
@@ -870,6 +870,8 @@
                     orientation = SwingConstants.HORIZONTAL;
                 }
 
+                e.consume();
+
                 if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
                     JViewport vp = scrollpane.getViewport();
                     if (vp == null) { return; }