<AWT Dev>  Review Request: JDK-8032872: [macosx] Cannot select from JComboBox in a JWindow
Sergey.Bylokhov at oracle.com
Mon Mar 3 01:01:11 PST 2014
Why the problem is reproduced in JWindow? Why it works in JFrame?
On 3/3/14 10:40 AM, dmitry markov wrote:
> 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().
Best regards, Sergey.
More information about the awt-dev