JDK-6852911 : Focus/caret does not return correctly after [windows]+[d](Show Desktop) in jdk6
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u14
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-06-19
  • Updated: 2011-02-16
  • Resolved: 2009-10-06
Related Reports
Relates :  
Relates :  
Description
There is a button called "Show Desktop" on the task bar.
When this is clicked, opened windows becomes icon. 
When clicked again, iconized windows show up again.
[windows]+[d] is assigned to this button as shot-cut key.

When a JavaSE licensee presses [windows]+[d] twice( whcih is, 
to iconize and restore windows), focus/caret in input field in java applicaitions 
disappears.

CONFIGURATION:
- OS : WindowsXP(SP2)/WindowsVista
- JDK : jdk5u18/jdk6u14

REPRODUCE:
1) Open "Notepad.jar" of Java Demo program
   (to invoke java -jar Notepad.jar)
2) input "abc'
   The caret is at the right of char. "c".
   You can see as follows.
 
    abc|

3) press [windows]+[d]  (Iconize)
4) press [windows]+[d]  (Restore)

5) There is no caret in the input field.

   abc

NOTE:
 1) This problem occurs in other Java aplicaitons. 
     ex. SwingSet2.jar
 2) The licensee tried the above reproduction procedure for
    notepad.exe in Windows. The caret is restored correctly.

Comments
EVALUATION Looks like focus is set on the toplevel itself after its restoring. This is due to the native system may send unexpectable focus messages on showing. The problem doesn't exist in JDK7 since b55 after the fix for 6806217. The latter restricts the native system to manage focus inside a toplevel.
24-06-2009

WORK AROUND Tab (or Shift-Tab) into the textfield if mouse is not applicable.
24-06-2009