From 947b8814056ea2fba6bbcfab86591f74bffc0311 Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 23 Sep 2005 21:31:04 +0000 Subject: Imported Classpath 0.18. * sources.am, Makefile.in: Updated. * Makefile.am (nat_source_files): Removed natProxy.cc. * java/lang/reflect/natProxy.cc: Removed. * gnu/classpath/jdwp/VMFrame.java, gnu/classpath/jdwp/VMIdManager.java, gnu/classpath/jdwp/VMVirtualMachine.java, java/lang/reflect/VMProxy.java: New files. 2005-09-23 Thomas Fitzsimmons * scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC list. 2005-09-23 Thomas Fitzsimmons * gnu/java/net/DefaultContentHandlerFactory.java (getContent): Remove ClasspathToolkit references. 2005-09-23 Thomas Fitzsimmons * gnu/awt/xlib/XCanvasPeer.java: Add new peer methods. * gnu/awt/xlib/XFramePeer.java: Likewise. * gnu/awt/xlib/XGraphicsConfiguration.java: Likewise. 2005-09-23 Thomas Fitzsimmons * Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add classpath/native/jawt/jawt.c. * Makefile.in: Regenerate. * jawt.c: Remove file. * include/Makefile.am (tool_include__HEADERS): Remove jawt.h and jawt_md.h. Add ../classpath/include/jawt.h and ../classpath/include/jawt_md.h. * include/Makefile.in: Regenerate. * include/jawt.h: Regenerate. * include/jawt_md.h: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104586 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../gnu/java/awt/peer/gtk/GtkFramePeer.java | 62 +++++++++++++++------- 1 file changed, 42 insertions(+), 20 deletions(-) (limited to 'libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java') diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java index b242d66adcb..6eb90ffa0bd 100644 --- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java +++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java @@ -44,6 +44,7 @@ import java.awt.Image; import java.awt.MenuBar; import java.awt.Rectangle; import java.awt.Window; +import java.awt.event.ComponentEvent; import java.awt.event.PaintEvent; import java.awt.image.ColorModel; import java.awt.peer.FramePeer; @@ -55,6 +56,7 @@ public class GtkFramePeer extends GtkWindowPeer private int menuBarHeight; private MenuBarPeer menuBar; native int getMenuBarHeight (MenuBarPeer bar); + native void setMenuBarWidthUnlocked (MenuBarPeer bar, int width); native void setMenuBarWidth (MenuBarPeer bar, int width); native void setMenuBarPeer (MenuBarPeer bar); native void removeMenuBarPeer (); @@ -117,6 +119,17 @@ public class GtkFramePeer extends GtkWindowPeer public void setBounds (int x, int y, int width, int height) { + // prevent window_configure_cb -> awtComponent.setSize -> + // peer.setBounds -> nativeSetBounds self-deadlock on GDK lock. + if (Thread.currentThread() == GtkToolkit.mainThread) + { + int menuBarWidth = width - insets.left - insets.right; + if (menuBar != null && menuBarWidth > 0) + setMenuBarWidthUnlocked (menuBar, menuBarWidth); + + return; + } + int menuBarWidth = width - insets.left - insets.right; if (menuBar != null && menuBarWidth > 0) setMenuBarWidth (menuBar, menuBarWidth); @@ -192,31 +205,25 @@ public class GtkFramePeer extends GtkWindowPeer protected void postConfigureEvent (int x, int y, int width, int height) { - int frame_x = x - insets.left; - // Since insets.top includes the MenuBar height, we need to add back - // the MenuBar height to the frame's y position. - // If no MenuBar exists in this frame, the MenuBar height will be 0. - int frame_y = y - insets.top + menuBarHeight; int frame_width = width + insets.left + insets.right; - // Ditto as above. Since insets.top already includes the MenuBar's height, - // we need to subtract the MenuBar's height from the top inset. + // Since insets.top already includes the MenuBar's height, we need + // to subtract the MenuBar's height from the top inset. int frame_height = height + insets.top + insets.bottom - menuBarHeight; - if (frame_x != awtComponent.getX() - || frame_y != awtComponent.getY() - || frame_width != awtComponent.getWidth() + + if (frame_width != awtComponent.getWidth() || frame_height != awtComponent.getHeight()) - { - if (frame_width != awtComponent.getWidth() && menuBar != null - && width > 0) - setMenuBarWidth (menuBar, width); + awtComponent.setSize(frame_width, frame_height); - setBoundsCallback ((Window) awtComponent, - frame_x, - frame_y, - frame_width, - frame_height); + int frame_x = x - insets.left; + // Likewise, since insets.top includes the MenuBar height, we need + // to add back the MenuBar height to the frame's y position. If + // no MenuBar exists in this frame, the MenuBar height will be 0. + int frame_y = y - insets.top + menuBarHeight; - awtComponent.validate(); + if (frame_x != awtComponent.getX() + || frame_y != awtComponent.getY()) + { + // awtComponent.setLocation(frame_x, frame_y); } } @@ -251,6 +258,21 @@ public class GtkFramePeer extends GtkWindowPeer { } + public void setBoundsPrivate(int x, int y, int width, int height) + { + // TODO Auto-generated method stub + + } + public void updateAlwaysOnTop() + { + // TODO Auto-generated method stub + + } + public boolean requestWindowFocus() + { + // TODO Auto-generated method stub + return false; + } } -- cgit v1.2.3