With Cacao and Classpath 0.9 running on FC4: Bug 1? ----- When running the attached program it locks upp when calling testPanel.setBounds(bounds); in MainFrame.java setSize() method Bug2? ----- I had to add a call to pack() in the MainFrame constructor, even though no layout manager is used. If you remove this call the Frame window is not created, even though show() is called from main. Why?
Created attachment 11114 [details] reproducer
this happened when not using Matchbox WM
The lockup is caused by GtkFramePeer.postConfigureEvent() which calls directly into the awtComponent.setSize() method from the gtk main thread while holding the gtk_threads lock.
This is actually 2 bugs: - Deadlock between GtkFramePeer.postConfigureEvent() and Component.setSize() - Without calling pack() the Frame without LayoutManager isn't shown. Working on a patch for the first issue.
Note that the test case is a little evil. It shows the frame first (triggering a configure event for the component) and only resizes the frame afterwards (while we might still be waiting for the first configure event to come in).
Patch for discussion posted: http://article.gmane.org/gmane.comp.java.classpath.patches/7911
(In reply to comment #4) > This is actually 2 bugs: > - Deadlock between GtkFramePeer.postConfigureEvent() and Component.setSize() > - Without calling pack() the Frame without LayoutManager isn't shown. The second issue is caused by an optimization in GtkComponent.setVisible() which doesn't show components with height or width of zero. If pack() hasn't been called on a Window/Frame then it still has a height and width of zero when show() is called. We should always show subclasses of Window in GtkComponent.setVisible().
Subject: Bug 26848 CVSROOT: /cvsroot/classpath Module name: classpath Branch: Changes by: Mark Wielaard <mark@savannah.gnu.org> 06/03/29 22:48:04 Modified files: . : ChangeLog gnu/java/awt/peer/gtk: GtkComponentPeer.java Log message: Partial fix for bug #26848 (pack). * gnu/java/awt/peer/gtk/GtkComponentPeer.java (setVisible): Always show instances of Window. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6944&tr2=1.6945&r1=text&r2=text http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java.diff?tr1=1.111&tr2=1.112&r1=text&r2=text
Fixes for both issues have been checked in.
Subject: Bug 26848 CVSROOT: /cvsroot/classpath Module name: classpath Branch: Changes by: Mark Wielaard <mark@savannah.gnu.org> 06/03/30 22:36:03 Modified files: . : ChangeLog Log message: Fix PR number. PR 26848 * java/awt/Window.java (dispatchEventImpl): On ComponentEvents adjust bounds. On resize invalidate and validate container. Always pass on ComponentEvents to Container super class. * gnu/java/awt/peer/gtk/GtkFramePeer.java (setBounds): Adjust for menuBar and pass to GtkWindowPeer super class. (postConfigureEvent): Adjust menu bar width. Adjust y and height bounds and pass to GtkWindowPeer super class. * gnu/java/awt/peer/gtk/GtkWindowPeer.java (x, y, width, height): New fields for local bounds. (getX, getY): New methods. (getWidth): Don't call into awtComponent. (getHeight): Likewise. (create): Cache local bounds. (setLocation): Documented, made protected and just call nativeSetLocation. (setLocationUnlocked): Removed unused method. (setBoundsUnlocked): Likewise. (setBounds): Check whether bounds actually changed and cache local bounds. (setSize): Documented and made protected. (setResizable): Documented and cache local bounds. (postConfigureEvent): Update local bounds. Don't call awtComponent directly but post ComponentEvents. (show): Cache local bounds. (getBounds): Override to return cached bounds. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6954&tr2=1.6955&r1=text&r2=text