JDK-6200789 : PIT: requestFocusInWindow transfers focus to a component in a frame which is not having focus
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: x86
  • Submitted: 2004-11-26
  • Updated: 2012-03-23
  • Resolved: 2005-02-12
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 6
6 b24Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
The testcase AWT_Focus/Automated/Lw/RequestFocusInWindowTest fails in the PIT build on Windows platform. It passes in mustang b13.

The testcase popups two frames. It transfers the focus to the second frame, calls requestFocusInWindow method on a component in the non-focused frame. With the PIT build, focus is transferred to the first frame and to the component, whereas it does not happen with b13. This occurs only on Windows platforms.

To reproduce:

Attached is the automated testcase
Compile the java files and run the testcase as follows:
$JAVA_HOME/bin/appletviewer -Xnosecurity -J-classpath -J<path to awtsqe.jar>/awtsqe.jar RequestFocusInWindowTest.html

awtsqe.jar is needed for the testcase to compile and run. It can be obtained from /net/sqesvr-nfs.sfbay/global/nfs/ws1/6.0_int/awt/share/lib/awtsqe


Comments
SUGGESTED FIX ------- awt_Component.cpp ------- *** /tmp/sccs.0FaO3Z Tue Dec 7 16:44:17 2004 --- awt_Component.cpp Tue Dec 7 16:42:07 2004 *************** *** 6880,6890 **** RequestFocusStruct *rfs = new RequestFocusStruct(); rfs->component = selfGlobalRef; rfs->lightweightChild = lightweightChildGlobalRef; rfs->temporary = temporary; ! rfs->focusedWindowChangeAllowed = rfs->focusedWindowChangeAllowed; rfs->time = time; return (jboolean)AwtToolkit::GetInstance().InvokeFunction( (void*(*)(void*))AwtComponent::_RequestFocus, rfs); // global refs and rfs are deleted in _RequestFocus --- 6880,6890 ---- RequestFocusStruct *rfs = new RequestFocusStruct(); rfs->component = selfGlobalRef; rfs->lightweightChild = lightweightChildGlobalRef; rfs->temporary = temporary; ! rfs->focusedWindowChangeAllowed = focusedWindowChangeAllowed; rfs->time = time; return (jboolean)AwtToolkit::GetInstance().InvokeFunction( (void*(*)(void*))AwtComponent::_RequestFocus, rfs); // global refs and rfs are deleted in _RequestFocus ###@###.### 2004-12-07 14:31:27 GMT
07-12-2004

EVALUATION There was quite a big fix for 5065001 in mustang b15 and some erratum fell into native code with it. It broke requestFocusInWindow() call logic. ###@###.### 2004-12-07 14:29:52 GMT
07-12-2004