United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7129825 [macosx] Native activation is not changed when focusing other frame's owned window
7129825 : [macosx] Native activation is not changed when focusing other frame's owned window

Details
Type:
Bug
Submit Date:
2012-01-13
Status:
Closed
Updated Date:
2012-05-17
Project Name:
JDK
Resolved Date:
2012-03-19
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u4
Fixed Versions:
7u4

Related Reports
Relates:

Sub Tasks

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/
                                     
2012-02-01
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.
                                     
2012-01-13



Hardware and Software, Engineered to Work Together