Revision: 4054
          http://vexi.svn.sourceforge.net/vexi/?rev=4054&view=rev
Author:   clrg
Date:     2011-03-17 10:33:21 +0000 (Thu, 17 Mar 2011)

Log Message:
-----------
Fix #37 by moving createBufferStrategy into EDT

Modified Paths:
--------------
    trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java     
2011-03-17 00:17:52 UTC (rev 4053)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java     
2011-03-17 10:33:21 UTC (rev 4054)
@@ -617,6 +617,15 @@
             public void setMinimumDimensions(int w, int h) { minimumSize = new 
Dimension(w, h); }
             public Dimension getMinimumSize() { return minimumSize; }
             public boolean isDoubleBuffered() { return true; }
+            /** for one-time calls that need to occur during the EDT */
+            public void addNotify() {
+                super.addNotify();
+                // initialize Swing's double buffering otherwise certain 
actions
+                // (notably resizing frames) will not be done smoothly
+                // NB Swing is double buffered by default but not sufficiently
+                createBufferStrategy(2);
+            }
+
 //            public ComponentAdapter enforceMinSize = new ComponentAdapter() {
 //                public void componentResized(ComponentEvent event) {
 //                    Dimension newDim = frame.getSize();
@@ -846,10 +855,6 @@
         // IMPORTANT: makeVisible must be called before render()
         // to ensure that our peer has been created
         public void makeVisible(boolean b) {
-            // initialize Swing's double buffering otherwise certain actions
-            // (notably resizing frames) will not be done smoothly
-            // NB: this must be called before setVisible(true)
-            if (b) window.createBufferStrategy(2);
             window.setVisible(b);
             // respect a frame's requested maximized state
             if (b && frame!=null) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to