JDK-6262815 : REG. Component in a Window doesn't gain focus when Window's parent is made visible from hidden state
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-04-28
  • Updated: 2011-01-19
  • Resolved: 2005-09-19
Related Reports
Duplicate :  
Description
I have a button in a window with focusable state set to true. The parent of the window is a Frame which is hidden. The window is visible and as expected, the button does not gain focus when clicked. Now, the parent Frame is made visible. Still the button in the window does not gain focus, when it is clicked. The same behavior occurs for a window with a Dialog as parent.

This occurs only with mustang builds, on Windows platform. It works with tiger rc build.

To reproduce:
1. Run the attached automated testcase

If the message at the command prompt says "FAIL: Window did not gain focus when it's nearest owning frame is shown on the screen", the bug is reproduced.
###@###.### 2005-04-28 12:56:33 GMT

Comments
EVALUATION This turned to be a duplicate of 6253913 integrated in b49. Indeed, the bug is not reproducible since b49.
19-09-2005

EVALUATION For all conditions which are involed into the calculation of isFocusableWindow result, the rule described in Window.setFocusableWindowState is applicable: "Setting the focusability state on a visible Window can have a delayed effect on some platforms ��� the actual change may happen only when the Window becomes hidden and then visible again. To ensure consistent behavior across platforms, set the Window's focusable state when the WIndow is invisible and then show it." That is, it is expected that to workaround this behavior one would need to hide/show the window. This needs to be verified though. ###@###.### 2005-04-28 13:43:55 GMT The workaround suggested above does work. But there's some bug in the test itself. It should negate its "focusGained" flag before the parent frame is set visible but not after as it did. ###@###.### 2005-06-27 09:44:19 GMT
28-04-2005