JDK-6447692 : Undecorated windows flash native decorations when being maximized
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-07-11
  • Updated: 2010-04-03
  • Resolved: 2006-07-13
Related Reports
Relates :  
Description
This issue first appeared as item #1 in bug 6425606.

When an undecorated top-level window is maximized (via setExtendedState()), the window's icon and title bar appear briefly as the window is maximizing.  Once maximized, the window is again undecorated.  Not a huge deal, but a bit distracting and certainly not proper behavior.

This bug has been present since the setUndecorated() API was added in 1.4 - I can reproduce on XP using 1.4.2_12, 1.5.0, and 1.6b85.

I used the following test case to reproduce this bug w/ an AWT Frame and a Swing JFrame:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class MaximizeTests implements ActionListener {
    static Frame frame;
    static Button awtBtn;
    static JFrame jframe;
    static JButton jBtn;

    public static void main(String[] args) {
        MaximizeTests al = new MaximizeTests();
        frame = new Frame("AWT Frame");
        frame.setUndecorated(true);
        awtBtn = new Button("Toggle Maximize");
        awtBtn.addActionListener(al);
        frame.add(awtBtn, BorderLayout.SOUTH);
        frame.add(new Label("AWT Frame"), BorderLayout.NORTH);
        frame.setBounds(10, 10, 200, 200);

        jframe = new JFrame("Swing Frame");
        jframe.setUndecorated(true);
        jBtn = new JButton("Toggle Maximize");
        jBtn.addActionListener(al);
        jframe.getContentPane().add(jBtn, BorderLayout.SOUTH);
        jframe.getContentPane().add(new JLabel("Swing Frame"), BorderLayout.NORTH);
        jframe.setBounds(220, 10, 200, 200);

        frame.setVisible(true);
        jframe.setVisible(true);
    }

    public void actionPerformed(ActionEvent e) {
        Frame src = null;
        if (e.getSource() == awtBtn) {
            src = frame;
        }
        else if (e.getSource() == jBtn) {
            src = jframe;
        }
        if (frame != null) {
            int state = src.getExtendedState();
            src.setExtendedState(state ^ Frame.MAXIMIZED_BOTH);
        }
    }
}

Comments
EVALUATION AWT specifyis correct style for undecorated windows, and it is Win32 that temporary shows window title on maximization. I have checked that all the native applications behave quite the same way, so this is not an AWT bug. Also, I should mention that the described behaviour can only be observed when all the animation effects are turned on (Control Panel -> Display -> Appearance -> Effects -> Use the following transition effect for menus and tooltips). Otherwise
12-07-2006