JDK-6525850 : Creating peer makes an invisible AND iconified frame visible on the taskbar
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2,6u1
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: other,x86
  • Submitted: 2007-02-16
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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 7
7 b14Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
This bug is reproducible on Windows.

Following are the steps to reproduce the defect.
 1.Create a frame with iconified state ----f.setExtendedState(Frame.ICONIFIED) and do not make it visible
 2.Create FileDialog with above frame as parent.
 3.call fileDialog(Visible)

 Expected Result: making file dialog visible should not Display frame 
 Actual Result: 1.It dislplays Frame (even though it is not visible) you can deiconify this frame,
                2. frame.isVisible() returns false.
		3. Alt + Tab dislplayes both frame icon as well as Dialog icon.

Same defect can be reproduced using following scearios.
                
1.Creating Window with frame as parent is Displaying frame and isVisible should return false.
  and alt tab should have only frame ICON.
2.Create A undecorated frame as iconified state and setVisble(false) and create a Dialog.
making the dialog Visible actually creates a Frame in iconified state.
The following code easily reproduces the bug:

**************************************************
import java.awt.Frame;

public class Test {
    public static void main(String[] args) {
        Frame f = new Frame("Parent");
        f.setExtendedState(Frame.ICONIFIED);
        f.pack();
    }
}
**************************************************

Comments
EVALUATION Apart from avoiding setting the WS_ICONIC style, it's necessary to move the AwtWindow::Reshape() function to the AwtFrame::Reshape(). This enables to check whether the frame is iconified examining the value of the AwtFrame::m_iconic boolean flag instead of examining the return value of ::IsIconic() Win API call. After the proposed fix applied the later method may not work correctly, because the WS_ICONIC style is not set while creating a peer but while showing the frame only.
15-05-2007

EVALUATION The problem is caused by the fact that MS Windows treats the WS_ICONIC window style (and AFAIR the WS_MAXIMIZED style as well) as if the WS_VISIBLE style is set as well. It means that creating a window with the WS_ICONIC style set implicitly causes the WS_VISIBLE style set as well, and therefore causes the window to appear on the taskbar.
08-05-2007

EVALUATION I have also created a native test that is closed to the Java test, but the parent window was not shown in the taskbar. So it seems like the problem is with Java code. Another interesting notice: even if the dialog is modal, I'm still able to restore its parent frame from the taskbar and operate with it as if it were modal excluded. In particular, this means that the frame is not shown from AWT shared code - either from peer code or from native code.
16-02-2007

EVALUATION At first I thought this issue may be caused by the code in AwtDialog::ModalFilterProc() as we restore iconified windows there. However, later I found this bug is reproduced even with JDK 5u11 and with modeless dialogs. Similiar problem may be reproduced with Window instead of Dialog.
16-02-2007