JDK-4464710 : Undecorated Frames cannot be shown initially iconified
  • Type: Bug
  • Status: Resolved
  • Resolution: Fixed
  • Component: client-libs
  • Sub-Component: java.awt
  • Priority: P4
  • Affected Version: 1.4.0
  • OS: windows_nt
  • CPU: x86
  • Submit Date: 2001-05-31
  • Updated Date: 2002-09-20
  • Resolved Date: 2002-09-20
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 Availabitlity Release.

To download the current JDK release, click here.
Other
1.4.2 mantisResolved
Related Reports
Relates :  
Relates :  
Description

Name: bsC130419			Date: 05/31/2001


java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

Undecorated frames cannot be programmatically iconified _before_
being shown. The code that follows shows that although the
frame is first iconified then shown, it gets shown in normal
  state. Notice that everything works fine if the frame is
decorated.
The workaround is to first show the undecorated frame, then
programmatically iconify it.

//--------------------------------------------
import javax.swing.*;

public class Undec extends JFrame
{
 public static void main(String args[])
 {
  new Undec();
 }

 public Undec()
 {
  setBounds(100, 100, 400, 250);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setUndecorated(true);
  setState(ICONIFIED);
  show();
 }
}
//--------------------------------------------
(Review ID: 125291) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b03
2004-06-14

WORK AROUND Name: bsC130419 Date: 05/31/2001 //-------------------------------------------- import javax.swing.*; public class Undec extends JFrame { public static void main(String args[]) { new Undec(); } public Undec() { setBounds(100, 100, 400, 250); setDefaultCloseOperation(EXIT_ON_CLOSE); setUndecorated(true); show(); setState(ICONIFIED); } } //-------------------------------------------- ======================================================================
2004-06-11

SUGGESTED FIX *** C:/WINNT/TEMP\geta1476 Tue Aug 27 20:30:20 2002 --- WFramePeer.java Tue Aug 27 20:11:57 2002 *************** *** 167,172 **** --- 167,173 ---- setTitle(target.getTitle()); } setResizable(target.isResizable()); + setState(target.getExtendedState()); Image icon = target.getIconImage(); if (icon != null) { --- awt_Frame.cpp Tue Aug 27 20:13:12 2002 *************** *** 199,211 **** } else if (env->GetBooleanField(target, AwtFrame::undecoratedID) == JNI_TRUE) { exStyle = 0; style = WS_POPUP | WS_SYSMENU | WS_CLIPCHILDREN | ! WS_MAXIMIZEBOX | WS_MINIMIZEBOX | ! ((state == java_awt_Frame_ICONIFIED) ? WS_ICONIC : 0); frame->m_isUndecorated = TRUE; } else { exStyle = WS_EX_WINDOWEDGE; ! style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | ! ((state == java_awt_Frame_ICONIFIED) ? WS_ICONIC : 0); } if (GetRTL()) { --- 199,209 ---- } else if (env->GetBooleanField(target, AwtFrame::undecoratedID) == JNI_TRUE) { exStyle = 0; style = WS_POPUP | WS_SYSMENU | WS_CLIPCHILDREN | ! WS_MAXIMIZEBOX | WS_MINIMIZEBOX; frame->m_isUndecorated = TRUE; } else { exStyle = WS_EX_WINDOWEDGE; ! style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN; } if (GetRTL()) {
2004-06-11

EVALUATION Name: vuR10080 Date: 08/26/2002 ###@###.### 2002-08-26 Submitter doesn't specify what window manager he uses. I can only reproduce it under OpenLook, but under OpenLook undecorated frames are implemented via OverrideRedirect and so are completely out of WM control. Since description says that programmatic iconification works later on, I assume he's not using OpenLook. I can reproduce this bug with Merlin b60 under CDE. Interestingly, same test under b60 works fine under fvwm. b70 (earliest > b65 that I can find around) and onward are fine under CDE as well. Propose to close as not reproducible. ====================================================================== | The problem is that when native object for the frame peer is created, | we don't record the frame state and rely on Windows to deliver WM_SIZE | message with proper state. This message is not sent to popup windows | (that undecorated frames are implemented with). The fix is to record | the target state when the native object is created. This also avoid | sending a false WINDOW_ICONIFIED event to the frame that is created | iconic. | | 4464714 is the same problem but for frames that are created initially | maximized. ###@###.### 2002-09-03
2002-09-03