<AWT Dev> [7u10] Review request for 7124375: [macosx] Focus isn't transfered as expected between components

Artem Ananiev artem.ananiev at oracle.com
Tue Sep 11 02:33:19 PDT 2012

Hi, Leonid,

the changes look fine. I would suggest a minor improvement, though. 
Right now setCurrentFocusedWindow() is only used on Mac OS X and X11. 
There is no need to add this method to KFM peer interface.



On 9/10/2012 8:52 PM, Leonid Romanov wrote:
> Hi,
> This is a back port of the fix that went into JDK 8.
> The main issue addressed by this fix is that information about current
> focused window and focus owner isn't shared among
> LWKeyboardFocusManagerPeer instances. Also, while the current
> KeyboardFocusManager code makes it look like each KeyboardFocusManager
> instance needs its own peer instance, the reality is different because
> both WKeyboardFocusManagerPeer and XKeyboardManagerPeer doesn't have non
> static fields. In other words, all the
> WKeyboardFocusManagerPeer/XKeyboardManagerPeer fields are static.
> Therefore, there is no need in in multiple peer instances, one singleton
> peer shared among all the KeyboardFocusManager instances is enough. This
> fix addresses that issue as well by explicitly turning
> KeyboardManagerPeer implementations into singletons for the sake of
> cleaner code.
> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7124375
> Webrev: http://cr.openjdk.java.net/~leonidr/7124375/webrev.01/
> Thanks,
> Leonid.

More information about the awt-dev mailing list