/[classpath]/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by fitzsim, Wed Aug 17 04:24:38 2005 UTC revision 1.39 by fitzsim, Thu Aug 18 01:22:00 2005 UTC
# Line 56  public class GtkFramePeer extends GtkWin Line 56  public class GtkFramePeer extends GtkWin
56    private int menuBarHeight;    private int menuBarHeight;
57    private MenuBarPeer menuBar;    private MenuBarPeer menuBar;
58    native int getMenuBarHeight (MenuBarPeer bar);    native int getMenuBarHeight (MenuBarPeer bar);
59      native void setMenuBarWidthUnlocked (MenuBarPeer bar, int width);
60    native void setMenuBarWidth (MenuBarPeer bar, int width);    native void setMenuBarWidth (MenuBarPeer bar, int width);
61    native void setMenuBarPeer (MenuBarPeer bar);    native void setMenuBarPeer (MenuBarPeer bar);
62    native void removeMenuBarPeer ();    native void removeMenuBarPeer ();
63    native void gtkFixedSetVisible (boolean visible);    native void gtkFixedSetVisible (boolean visible);
64    
65      private boolean resizing = false;
66    
67    int getMenuBarHeight ()    int getMenuBarHeight ()
68    {    {
69      return menuBar == null ? 0 : getMenuBarHeight (menuBar);      return menuBar == null ? 0 : getMenuBarHeight (menuBar);
# Line 118  public class GtkFramePeer extends GtkWin Line 121  public class GtkFramePeer extends GtkWin
121    
122    public void setBounds (int x, int y, int width, int height)    public void setBounds (int x, int y, int width, int height)
123    {    {
124        // prevent window_configure_cb -> awtComponent.setSize ->
125        // peer.setBounds -> nativeSetBounds self-deadlock on GDK lock.
126        if (resizing && Thread.currentThread() == GtkToolkit.mainThread)
127          {
128            int menuBarWidth = width - insets.left - insets.right;
129            if (menuBar != null && menuBarWidth > 0)
130              setMenuBarWidthUnlocked (menuBar, menuBarWidth);
131    
132            resizing = false;
133            return;
134          }
135    
136      int menuBarWidth = width - insets.left - insets.right;      int menuBarWidth = width - insets.left - insets.right;
137      if (menuBar != null && menuBarWidth > 0)      if (menuBar != null && menuBarWidth > 0)
138        setMenuBarWidth (menuBar, menuBarWidth);        setMenuBarWidth (menuBar, menuBarWidth);
# Line 200  public class GtkFramePeer extends GtkWin Line 215  public class GtkFramePeer extends GtkWin
215    
216      if (frame_width != awtComponent.getWidth()      if (frame_width != awtComponent.getWidth()
217          || frame_height != awtComponent.getHeight())          || frame_height != awtComponent.getHeight())
218        awtComponent.setSize(frame_width, frame_height);        {
219            resizing = true;
220            awtComponent.setSize(frame_width, frame_height);
221          }
222    
223      int frame_x = x - insets.left;      int frame_x = x - insets.left;
224      // Likewise, since insets.top includes the MenuBar height, we need      // Likewise, since insets.top includes the MenuBar height, we need

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26