JDK-6522374 : XEmbeddedFrame doesn't reconfigure itself on ConfigureNotify
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2007-02-07
  • Updated: 2011-05-17
  • Resolved: 2011-05-17
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 JDK 6 JDK 7
5.0-poolResolved 6u10Fixed 7 b09Fixed
Related Reports
Relates :  
Description
XEmbeddedFramePeer doen't correctly change it geometry on ConfigureNotify.
It just set x, y, width, and height fields, but it looks like we need to update
geometry of content window (and perhaps something else).

And this cause the following bug in AWT-SWT bridge

https://bugs.eclipse.org/bugs/show_bug.cgi?id=168043

Comments
SUGGESTED FIX the core part of the fix is : +++ XEmbeddedFramePeer.java 2007-02-13 18:25:17.000000000 +0300 @@ -5,23 +5,24 @@ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package sun.awt.X11; -import sun.awt.EmbeddedFrame; -import sun.awt.X11.XEmbeddedFrame; -import java.awt.peer.ComponentPeer; import java.awt.*; -import java.awt.event.ComponentEvent; -import java.util.logging.*; -import java.awt.AWTKeyStroke; + import java.util.LinkedList; import java.util.Iterator; +import java.util.logging.Level; +import java.util.logging.Logger; + +import sun.awt.EmbeddedFrame; +import sun.awt.SunToolkit; + public class XEmbeddedFramePeer extends XFramePeer { - private static final Logger xembedLog = Logger.getLogger("sun.awt.X11.xembed"); + private static final Logger xembedLog = Logger.getLogger("sun.awt.X11.xembed.XEmbeddedFramePeer"); LinkedList<AWTKeyStroke> strokes; XEmbedClientHelper embedder; // Caution - can be null if XEmbed is not supported public XEmbeddedFramePeer(EmbeddedFrame target) { @@ -109,37 +110,41 @@ return super.isEventDisabled(e); } public void handleConfigureNotifyEvent(XEvent xev) { + assert (SunToolkit.isAWTLockHeldByCurrentThread()); + XConfigureEvent xe = xev.get_xconfigure(); + if (xembedLog.isLoggable(Level.FINE)) { + xembedLog.fine(xe.toString()); + } + // fix for 5063031 // if we use super.handleConfigureNotifyEvent() we would get wrong - // size and position because embedded frame really is NOT a decorated one - - XConfigureEvent xe = xev.get_xconfigure(); - + // size and position because embedded frame really is NOT a decorated one checkIfOnNewScreen(toGlobal(new Rectangle(xe.get_x(), - xe.get_y(), - xe.get_width(), - xe.get_height()))); - - + xe.get_y(), + xe.get_width(), + xe.get_height()))); + Rectangle oldBounds = getBounds(); - - x = xe.get_x(); - y = xe.get_y(); - width = xe.get_width(); - height = xe.get_height(); - - Rectangle bounds = getBounds(); - if (!bounds.getSize().equals(oldBounds.getSize())) { - postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED)); - } - if (!bounds.getLocation().equals(oldBounds.getLocation())) { - postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED)); - } - } + + synchronized (getStateLock()) { + x = xe.get_x(); + y = xe.get_y(); + width = xe.get_width(); + height = xe.get_height(); + + dimensions.setClientSize(width, height); + dimensions.setLocation(x, y); + } + + if (!getLocation().equals(oldBounds.getLocation())) { + handleMoved(dimensions); + } + reconfigureContentWindow(dimensions); + } protected void traverseOutForward() { if (embedder != null && embedder.isActive()) { if (embedder.isApplicationActive()) { xembedLog.fine("Traversing out Forward"); this could be used for backporting. The full fix could be found at http://javaweb.sfbay/jcg/7/awt/6522374/ (and it is attached)
2007-02-14

EVALUATION to fix this I update dimentions of the embedded frame and call handleMoved() and reconfigureContentWindow()
2007-02-09

EVALUATION the problem is that we do not reconfigure embedded frame's content window.
2007-02-09