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

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

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

revision 1.39 by fitzsim, Fri Aug 19 01:29:26 2005 UTC revision 1.40 by fitzsim, Thu Aug 25 02:26:49 2005 UTC
# Line 60  public class GtkWindowPeer extends GtkCo Line 60  public class GtkWindowPeer extends GtkCo
60    private boolean hasBeenShown = false;    private boolean hasBeenShown = false;
61    private int oldState = Frame.NORMAL;    private int oldState = Frame.NORMAL;
62    
   private boolean resizing = false;  
   
63    native void gtkWindowSetTitle (String title);    native void gtkWindowSetTitle (String title);
64    native void gtkWindowSetResizable (boolean resizable);    native void gtkWindowSetResizable (boolean resizable);
65    native void gtkWindowSetModal (boolean modal);    native void gtkWindowSetModal (boolean modal);
# Line 124  public class GtkWindowPeer extends GtkCo Line 122  public class GtkWindowPeer extends GtkCo
122    {    {
123      // prevent window_configure_cb -> awtComponent.setSize ->      // prevent window_configure_cb -> awtComponent.setSize ->
124      // peer.setBounds -> nativeSetBounds self-deadlock on GDK lock.      // peer.setBounds -> nativeSetBounds self-deadlock on GDK lock.
125      if (resizing && Thread.currentThread() == GtkToolkit.mainThread)      if (Thread.currentThread() == GtkToolkit.mainThread)
126        {        return;
127          resizing = false;  
         return;  
       }  
128      nativeSetBounds (x, y,      nativeSetBounds (x, y,
129                       width - insets.left - insets.right,                       width - insets.left - insets.right,
130                       height - insets.top - insets.bottom);                       height - insets.top - insets.bottom);
# Line 167  public class GtkWindowPeer extends GtkCo Line 163  public class GtkWindowPeer extends GtkCo
163      insets.right = right;      insets.right = right;
164    }    }
165    
166      // called back by native side: window_configure_cb
167      // only called from GTK thread
168    protected void postConfigureEvent (int x, int y, int width, int height)    protected void postConfigureEvent (int x, int y, int width, int height)
169    {    {
170      int frame_width = width + insets.left + insets.right;      int frame_width = width + insets.left + insets.right;
# Line 174  public class GtkWindowPeer extends GtkCo Line 172  public class GtkWindowPeer extends GtkCo
172    
173      if (frame_width != awtComponent.getWidth()      if (frame_width != awtComponent.getWidth()
174          || frame_height != awtComponent.getHeight())          || frame_height != awtComponent.getHeight())
175        {        awtComponent.setSize(frame_width, frame_height);
         resizing = true;  
         awtComponent.setSize(frame_width, frame_height);  
       }  
176    
177      int frame_x = x - insets.left;      int frame_x = x - insets.left;
178      int frame_y = y - insets.top;      int frame_y = y - insets.top;
# Line 189  public class GtkWindowPeer extends GtkCo Line 184  public class GtkWindowPeer extends GtkCo
184        }        }
185    }    }
186    
187    native void nativeSetVisible (boolean b);    public void show ()
   public void setVisible (boolean b)  
   {  
     // Prevent the window manager from automatically placing this  
     // window when it is shown.  
     if (b)  
       setBounds (awtComponent.getX(),  
                  awtComponent.getY(),  
                  awtComponent.getWidth(),  
                  awtComponent.getHeight());  
     nativeSetVisible (b);  
   }  
   
   native void nativeSetVisibleUnlocked (boolean b);  
   public void setVisibleUnlocked (boolean b)  
188    {    {
189      // Prevent the window manager from automatically placing this      // Prevent the window manager from automatically placing this
190      // window when it is shown.      // window when it is shown.
191      if (b)      setBounds (awtComponent.getX(),
192        setBoundsUnlocked (awtComponent.getX(),                 awtComponent.getY(),
193                           awtComponent.getY(),                 awtComponent.getWidth(),
194                           awtComponent.getWidth(),                 awtComponent.getHeight());
195                           awtComponent.getHeight());      setVisible (true);
     nativeSetVisibleUnlocked (b);  
196    }    }
197    
198    void postWindowEvent (int id, Window opposite, int newState)    void postWindowEvent (int id, Window opposite, int newState)

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

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