Hello,

Could you review the fix for jdk9, please?

bug: https://bugs.openjdk.java.net/browse/JDK-8032872
webrev: http://cr.openjdk.java.net/~dmarkov/8032872/jdk9/webrev.00/

Problem description: It is impossible to make a selection in JComboBox added to JWindow via the mouse. The problem is caused by incorrect mouse events handling in LWWindowPeer class. When LWWindowPeer receives a mouse event intended for a popup window, it checks whether the current grabbingWindow is owner of the popup using getOwnerFrameDialog() method. This approach always fails for the JComboBox added to JWindow. As a result an UngrabEvent is send to the popup window.

Fix: Introduce new private method LWWindowPeer.isOneOfOwnersOf(LWWindowPeer peer). The method will be invoked on grabbingWindow object to test whether it is owner of current mouse event target or not. The usage of getOwnerFrameDialog() should be replaced by isOneOfOwnersOf() in LWWindowPeer.notifyMouseEvent() and LWWindowPeer.NotifyNCMouseDown().

Thanks,
Dmitry

Reply via email to