Hi everyone,
Could you tell what window manager you're using when you observe
this behavior? Did you try running under Metacity? Is the bug still
reproducible then?
This was tested under Metacity and it is still a bug.
Sun accepted this bug this morning as bug 6586752.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6586752
This problem was narrowed down to a regression between b14 and b15. The
patch causing the problem has been uploaded here:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=37
Though, we are still trying to determine what part of this patch is the
cause.
I've found the specific area that causes this regression; it was the
change in XPanelPeer.java. I've attached the relevant b14->b15 diff; if
you revert that patch then window decorations appear once again.
Regards,
Francis
diff -urN openjdk-b14/j2se/src/solaris/classes/sun/awt/X11/XPanelPeer.java openjdk-b15/j2se/src/solaris/classes/sun/awt/X11/XPanelPeer.java
--- openjdk-b14/j2se/src/solaris/classes/sun/awt/X11/XPanelPeer.java 2007-06-21 03:47:55.000000000 -0400
+++ openjdk-b15/j2se/src/solaris/classes/sun/awt/X11/XPanelPeer.java 2007-07-05 03:53:10.000000000 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
import java.awt.*;
import java.awt.peer.*;
+
import sun.awt.SunGraphicsCallback;
public class XPanelPeer extends XCanvasPeer implements PanelPeer {
@@ -129,41 +130,36 @@
return getInsets();
}
- /**
- * Recursive method that handles the propagation of the displayChanged
- * event into the entire hierarchy of peers.
- * Unlike on win32, on X we don't worry about handling on-the-fly
- * display settings changes, only windows being dragged across Xinerama
- * screens. Thus, we only need to tell XCanvasPeers, not all
- * XComponentPeers.
+ /*
+ * This method is called from XWindowPeer.displayChanged, when
+ * the window this Panel is on is moved to the new screen, or
+ * display mode is changed.
+ *
+ * The notification is propagated to the child Canvas components.
+ * Top-level windows and other Panels are notified too as their
+ * peers are subclasses of XCanvasPeer.
*/
- private void recursiveDisplayChanged(Component c, int screenNum) {
- if (c instanceof Container) {
- Component children[] = ((Container)c).getComponents();
- for (int i = 0; i < children.length; ++i) {
- recursiveDisplayChanged(children[i], screenNum);
- }
- }
- ComponentPeer peer = c.getPeer();
- if (peer != null && peer instanceof XCanvasPeer) {
- XCanvasPeer mPeer = (XCanvasPeer)peer;
- mPeer.displayChanged(screenNum);
- }
+ public void displayChanged(int screenNum) {
+ super.displayChanged(screenNum);
+ displayChanged((Container)target, screenNum);
}
/*
- * Often up-called from a XWindowPeer instance.
- * Calls displayChanged() on all child canvas' peers.
- * Recurses into Container children to ensure all canvases
- * get the message.
+ * Recursively iterates through all the HW and LW children
+ * of the container and calls displayChanged() for HW peers.
+ * Iteration through children peers only is not enough as the
+ * displayChanged notification may not be propagated to HW
+ * components inside LW containers, see 4452373 for details.
*/
- public void displayChanged(int screenNum) {
- // Don't do super call because XWindowPeer has already updated its GC
-
+ private static void displayChanged(Container target, int screenNum) {
Component children[] = ((Container)target).getComponents();
-
- for (int i = 0; i < children.length; i++) {
- recursiveDisplayChanged(children[i], screenNum);
+ for (Component child : children) {
+ ComponentPeer cpeer = child.getPeer();
+ if (cpeer instanceof XCanvasPeer) {
+ ((XCanvasPeer)cpeer).displayChanged(screenNum);
+ } else if (child instanceof Container) {
+ displayChanged((Container)child, screenNum);
+ }
}
}