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

Log Message:
-----------
Fix #35 - new frames not always respecting Maximized requests

Modified Paths:
--------------
    trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java
    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/AWT.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java       
2011-03-17 00:11:07 UTC (rev 4052)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java       
2011-03-17 00:17:52 UTC (rev 4053)
@@ -669,7 +669,14 @@
 
         // IMPORTANT: makeVisible must be called before render()
         // to ensure that our peer has been created
-        public void makeVisible(boolean b) { window.setVisible(b); }
+        public void makeVisible(boolean b) {
+            window.setVisible(b);
+            // respect a frame's requested maximized state
+            // NB must be called after setVisible(true)
+            if (b && frame!=null) {
+                frame.setExtendedState(maximized ? Frame.MAXIMIZED_BOTH : 
Frame.NORMAL);
+            }
+        }
         
         public void _dispose() {
             window.removeMouseListener(this);

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:11:07 UTC (rev 4052)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java     
2011-03-17 00:17:52 UTC (rev 4053)
@@ -851,6 +851,10 @@
             // 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) {
+                frame.setExtendedState(maximized ? Frame.MAXIMIZED_BOTH : 
Frame.NORMAL);
+            }
         }
         
         public void _dispose() {


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