Skip to content
This repository
Browse code

git-svn-id: http://svn.gna.org/svn/fullscreen-p5/trunk@12 2047cd6a-46…

…a1-4efc-9f20-c343b47ea501
  • Loading branch information...
commit 5a1fbbddf7b24b1d8994c16639677c9f0eba1237 1 parent 18f96ce
authored June 10, 2008

Showing 1 changed file with 8 additions and 21 deletions. Show diff stats Hide diff stats

  1. 29  src/fullscreen/SoftFullScreen.java
29  src/fullscreen/SoftFullScreen.java
@@ -25,6 +25,7 @@
25 25
 import java.awt.GraphicsDevice;
26 26
 
27 27
 import processing.core.PApplet;
  28
+import processing.core.PConstants;
28 29
 
29 30
 /**
30 31
  * FullScreen support for processing. 
@@ -83,8 +84,10 @@ public SoftFullScreen( PApplet dad ){
83 84
 		fsFrame.setUndecorated( true ); 
84 85
 		fsFrame.setBackground( Color.black ); 
85 86
 		fsFrame.setLayout( null ); 
86  
-		//fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
87  
-		fsFrame.setSize( dad.width, dad.height ); 
  87
+		fsFrame.setSize( 
  88
+			Math.max( fsDevice.getDisplayMode().getWidth(), dad.width ), 
  89
+			Math.max( fsDevice.getDisplayMode().getHeight(), dad.height )
  90
+		);
88 91
 		
89 92
 		registerFrame( fsFrame ); 
90 93
 	}
@@ -117,15 +120,6 @@ public boolean available(){
117 120
 	 * @returns true on success
118 121
 	 */
119 122
 	public void setFullScreen( boolean fullScreen ){
120  
-		// If it's called from setup we wait until the applet initialized properly
121  
-		/*if( dad.frameCount == 0 && fullScreen == true ){
122  
-			new FSWaitForInitThread().start(); 
123  
-			
124  
-			return; 
125  
-		}*/
126  
-		
127  
-		
128  
-		
129 123
 		if( fullScreen == isFullScreen() ){
130 124
 			// no change required! 
131 125
 			return; 
@@ -134,18 +128,10 @@ else if( fullScreen ){
134 128
 			if( available() ){
135 129
 				// remove applet from processing frame and attach to fsFrame
136 130
 				fsFrame.setVisible( false );
137  
-				/*dad.frame.setSize(
138  
-					dad.width + dad.frame.insets().left + dad.frame.insets().right, 
139  
-					dad.height + dad.frame.insets().top + dad.frame.insets().bottom 
140  
-				);*/
141  
-				//fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
142  
-				fsFrame.setSize( dad.width, dad.height ); 
143  
-
144  
-				
145 131
 				fsFrame.add( dad ); 
146 132
 				dad.requestFocus(); 
147 133
 				
148  
-				if( dad.platform == dad.MACOSX ){
  134
+				if( PApplet.platform == PConstants.MACOSX ){
149 135
 					new NativeOSX().setVisible( false ); 
150 136
 				}
151 137
 				
@@ -153,6 +139,7 @@ else if( fullScreen ){
153 139
 				fsFrame.setLocation( 0, 0 ); 
154 140
 				dad.setLocation( ( fsFrame.getWidth() - dad.width ) / 2, ( fsFrame.getHeight() - dad.height ) / 2 ); 
155 141
 				
  142
+				notifySketch( dad ); 
156 143
 				return; 
157 144
 			}
158 145
 			else{
@@ -162,7 +149,6 @@ else if( fullScreen ){
162 149
 		}
163 150
 		else{
164 151
 			// remove applet from fsFrame and attach to processing frame
165  
-			System.out.println( "hide" ); 
166 152
 			fsFrame.removeAll(); 
167 153
 			dad.frame.add( dad ); 
168 154
 			dad.setLocation( dad.frame.insets().left, dad.frame.insets().top );
@@ -175,6 +161,7 @@ else if( fullScreen ){
175 161
 			fsFrame.setVisible( false ); 
176 162
 			dad.frame.setVisible( true ); 
177 163
 			dad.requestFocus(); 
  164
+			notifySketch( dad ); 
178 165
 			
179 166
 			return; 
180 167
 		}

0 notes on commit 5a1fbbd

Please sign in to comment.
Something went wrong with that request. Please try again.