JDK-7129825 : [macosx] Native activation is not changed when focusing other frame's owned window
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u4
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-01-13
  • Updated: 2012-05-17
  • Resolved: 2012-03-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7u4 b11Fixed
Related Reports
Relates :  
Description
Say, there's a frame F0 with an owned window. There's also a frame F1.
When F1 is active and the window is clicked it does receive focus, all the
focus/activation events generated are correct, though the frame F1 remains
natively active (has a highlighted title), while the frame F0 should actually
become such.

Here's the test case:

import java.awt.*;
import java.awt.event.*;
import java.awt.event.AWTEventListener;

public class Test {
    public static void main(String[] args) {
        
        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
            public void eventDispatched(AWTEvent e) {
                System.err.println(e);
            }
        }, FocusEvent.FOCUS_EVENT_MASK |
           WindowEvent.WINDOW_FOCUS_EVENT_MASK |
           WindowEvent.WINDOW_EVENT_MASK);
        
        Frame f0 = new Frame("f0");
        Frame f1 = new Frame("f1");
        Window w = new Window(f0);
        Button b = new Button("button");
        
        f0.setBounds(0, 0, 100, 100);
        f1.setBounds(300, 0, 100, 100);
        w.setBounds(0, 300, 100, 100);
        w.add(b);

        f1.setVisible(true);        
        f0.setVisible(true);
        w.setVisible(true);
    }
}

Comments
SUGGESTED FIX http://cr.openjdk.java.net/~ant/7129825/webrev.1/
01-02-2012

EVALUATION This is due to native unfocusability of a simple window. When it's clicked, proper focus activation is initiated on java level, though natively nothing changes.
13-01-2012