United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6507476 XEmbeddedFrame gets focused when a modal dialog is shown
JDK-6507476 : XEmbeddedFrame gets focused when a modal dialog is shown

Details
Type:
Bug
Submit Date:
2006-12-22
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
client-libs
OS:
linux
Sub-Component:
java.awt
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Tonga test AWT_SWT/Automated//Modality fails with two error messages:

FAILURE: SWT button got selected inspite of modal dialog
FAILURE: AWT button gained focus inspite of modal dialog

The first is the common problem: there is no API for AWT embedded frame to notify its embedding container (SWT shell) that some modal dialog is shown. Thus, when user clicks on the SWT button, SWT shell successfully activated.

However, the second failure is related to AWT. AWT components shouldn't get focus when their top-level window (even if this window is embedded frame) is blocked by modal dialog.

                                    

Comments
EVALUATION

When SWT shell is activated, it sends us the client message XEMBED_WINDOW_ACTIVATE. Then, when AWT button is clicked with the mouse, embedded frame sends XEMBED_REQUEST_FOCUS client message to the SWT shell and receives a reply as XEMBED_FOCUS_IN. However, if the embedded frame is blocked (or is unfocusable because of some another reason), it shouldn't request focus from embedder.

Also, I haven't found any place in XEmbed specification that states that XEMBED_FOCUS_IN is only sent in reply to XEMBED_REQUEST_FOCUS. So we should not only prevent our embedded frames from requesting focus, but also filter all XEMBED_FOCUS_IN messages when the frame is unfocusable.
                                     
2006-12-22



Hardware and Software, Engineered to Work Together