JDK-5050898 : a Window(Frame) fails to Hide() on X-Win gimp-panel context switch
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux,linux_redhat_9.0
  • CPU: x86
  • Submitted: 2004-05-21
  • Updated: 2006-10-06
  • Resolved: 2006-10-06
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Name: rmT116609			Date: 05/20/2004


FULL PRODUCT VERSION :
ava version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux MyLaptop 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
using XWin/gimp with 8 user selectable/switchable panels.

A DESCRIPTION OF THE PROBLEM :
the new Window( Frame ) does not disappear ( hide(), setVisible(false) ) when I select a different X Windows Gimp Panel to work on.  A windown with a Frame() disappears when i context switch between gimp panels. But the Window(Frame) is painted on each of the Gimp Panels.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run program.
Select the "press this button" painted on the top left of the screen
a row of buttons will be painted at location(200,200);

Now switch working Gimp panels. The press this button disappears. The row of 10 buttons appear on each of the gimp panels.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
At first I though I had to do something to catch a Window event, and do something appropriate. But I saw that 1.4, and 1.3 both java panels disappeared when I context switched between gimp panels.

Now I expect that both java panels should have disappeared.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/*
 * FloatFrame.java
 *
 * Created on May 19, 2004, 1:46 PM
 */

/**
 *
 * @author  gat
 */
import  java.awt.*;

public class FloatFrame extends java.awt.Frame {
    
    /** Creates new form FloatFrame */
    public FloatFrame() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        button1 = new java.awt.Button();

        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
            }
        });

        button1.setLabel("Press This Button");
        button1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                button1MouseClicked(evt);
            }
        });

        add(button1, java.awt.BorderLayout.CENTER);

        pack();
    }//GEN-END:initComponents

    private void button1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_button1MouseClicked
        // Add your handling code here:
        Frame f = null;
        Component t = evt.getComponent();
        Window win;
        System.out.println("button1MouseClicked");
        while ( ( t = t.getParent() ) != null ) {
            if ( t instanceof Frame )
                f = (Frame) t;
        }
        if ( f == null )
            return;
        System.out.println("button1MouseClicked: 4");
        win = new Window( f );
        Panel p = new panel();
        win.add( p );
        win.setSize( 200, 200 );
        win.setLocation( 200,200 );
        win.pack();
        win.show();
    }//GEN-LAST:event_button1MouseClicked
    
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
        System.exit(0);
    }//GEN-LAST:event_exitForm
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        new FloatFrame().show();
    }
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Button button1;
    // End of variables declaration//GEN-END:variables
    
}


class panel extends java.awt.Panel {
    
    panel() {
        for ( int i =0; i < 10; i++ )
            add( new Button( "B"+i ) );
    }
}
---------- END SOURCE ----------
(Incident Review ID: 270432) 
======================================================================

Comments
EVALUATION Closing this bug as a duplicate of a bug with a bigger number, I would note it is fixed in jdk7 b03 with 6380835.
06-10-2006

EVALUATION Name: osR10079 Date: 05/20/2004 The problem is reproducible with b51. ###@###.### 2004-05-21 ====================================================================== Name: ynR10250 Date: 05/21/2004 basic Window is implemented with override-redirect==true, so desktop manager does not control it. We need to track it in our code if Window belongs to a specific virtual desktop. Should fix it in dragonfly perhaps. ###@###.### ======================================================================
22-09-2004

WORK AROUND Name: ynR10250 Date: 05/21/2004 Use undecorated Frame instead of Window; it is right thing to do anyway. ======================================================================
22-09-2004