Permalink
Browse files

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

…a1-4efc-9f20-c343b47ea501
  • Loading branch information...
1 parent 18f96ce commit 5a1fbbddf7b24b1d8994c16639677c9f0eba1237 kritzikratzi committed Jun 10, 2008
Showing with 8 additions and 21 deletions.
  1. +8 −21 src/fullscreen/SoftFullScreen.java
@@ -25,6 +25,7 @@
import java.awt.GraphicsDevice;
import processing.core.PApplet;
+import processing.core.PConstants;
/**
* FullScreen support for processing.
@@ -83,8 +84,10 @@ public SoftFullScreen( PApplet dad ){
fsFrame.setUndecorated( true );
fsFrame.setBackground( Color.black );
fsFrame.setLayout( null );
- //fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
- fsFrame.setSize( dad.width, dad.height );
+ fsFrame.setSize(
+ Math.max( fsDevice.getDisplayMode().getWidth(), dad.width ),
+ Math.max( fsDevice.getDisplayMode().getHeight(), dad.height )
+ );
registerFrame( fsFrame );
}
@@ -117,15 +120,6 @@ public boolean available(){
* @returns true on success
*/
public void setFullScreen( boolean fullScreen ){
- // If it's called from setup we wait until the applet initialized properly
- /*if( dad.frameCount == 0 && fullScreen == true ){
- new FSWaitForInitThread().start();
-
- return;
- }*/
-
-
-
if( fullScreen == isFullScreen() ){
// no change required!
return;
@@ -134,25 +128,18 @@ else if( fullScreen ){
if( available() ){
// remove applet from processing frame and attach to fsFrame
fsFrame.setVisible( false );
- /*dad.frame.setSize(
- dad.width + dad.frame.insets().left + dad.frame.insets().right,
- dad.height + dad.frame.insets().top + dad.frame.insets().bottom
- );*/
- //fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
- fsFrame.setSize( dad.width, dad.height );
-
-
fsFrame.add( dad );
dad.requestFocus();
- if( dad.platform == dad.MACOSX ){
+ if( PApplet.platform == PConstants.MACOSX ){
new NativeOSX().setVisible( false );
}
fsFrame.setVisible( true );
fsFrame.setLocation( 0, 0 );
dad.setLocation( ( fsFrame.getWidth() - dad.width ) / 2, ( fsFrame.getHeight() - dad.height ) / 2 );
+ notifySketch( dad );
return;
}
else{
@@ -162,7 +149,6 @@ else if( fullScreen ){
}
else{
// remove applet from fsFrame and attach to processing frame
- System.out.println( "hide" );
fsFrame.removeAll();
dad.frame.add( dad );
dad.setLocation( dad.frame.insets().left, dad.frame.insets().top );
@@ -175,6 +161,7 @@ else if( fullScreen ){
fsFrame.setVisible( false );
dad.frame.setVisible( true );
dad.requestFocus();
+ notifySketch( dad );
return;
}

0 comments on commit 5a1fbbd

Please sign in to comment.