diff -urNw aquavcl01/vcl/aqua/inc/salframe.h myaquavcl01/vcl/aqua/inc/salframe.h --- aquavcl01/vcl/aqua/inc/salframe.h 2006-04-27 15:47:01.000000000 -0500 +++ myaquavcl01/vcl/aqua/inc/salframe.h 2006-07-26 15:22:33.000000000 -0500 @@ -77,7 +77,10 @@ int mnMinHeight; // min. client height in pixeln int mnMaxWidth; // max. client width in pixeln int mnMaxHeight; // max. client height in pixeln + Rect maFullScreenRect; // old window size when in FullScreen + WindowAttributes maFullScreenAttr; // old window attributes when in FullScreen BOOL mbGraphics; // is Graphics used? + BOOL mbFullScreen; // is Window in FullScreen? AquaSalInstance* mpSalInstance; public: diff -urNw aquavcl01/vcl/aqua/source/window/salframe.cxx myaquavcl01/vcl/aqua/source/window/salframe.cxx --- aquavcl01/vcl/aqua/source/window/salframe.cxx 2006-07-19 05:22:11.000000000 -0500 +++ myaquavcl01/vcl/aqua/source/window/salframe.cxx 2006-07-28 06:31:56.000000000 -0500 @@ -69,6 +69,27 @@ return 0; } +static void ImplSalCalcFullScreenSize( const AquaSalFrame* pFrame, Rect* pSize ) +{ + /** FIXME ** + * Implement multiple displays here. That's why a pointer + * to frame is passed. But pointer not currently used. + **/ + CGDirectDisplayID mainDisplayID = CGMainDisplayID(); + printf("Display ID %d\n", mainDisplayID); + + CGRect rect; + rect = CGDisplayBounds( mainDisplayID ); + printf( "Screen resolution: %fx%f\n", rect.size.width, rect.size.height ); + + // Stores current resolution in pSize. + // Rect made out of ints -> cast required -> CGRect made out of floats. + pSize->top = 0; + pSize->left = 0; + pSize->bottom = static_cast(rect.size.height); + pSize->right = static_cast(rect.size.width); +} + // ======================================================================= AquaSalFrame::AquaSalFrame() : @@ -345,6 +366,29 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen ) { fprintf(stderr, ">*>_> %s\n",__func__); + + if( mbFullScreen == bFullScreen ) + return; + + mbFullScreen = bFullScreen; + AquaSalFrame* pFrame = this; + if( bFullScreen ) + { + Rect newBounds; + ImplSalCalcFullScreenSize( pFrame, &newBounds ); // Get new bounds + GetWindowAttributes( mrWindow, &maFullScreenAttr ); // Save attributes + ChangeWindowAttributes( mrWindow, kWindowNoAttributes, maFullScreenAttr ); + GetWindowBounds( mrWindow, kWindowContentRgn, &maFullScreenRect ); + SetWindowBounds( mrWindow, kWindowContentRgn, &newBounds ); + SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar ); + // -> Shows menubar when we move the mouse over it. + } + else + { + SetWindowBounds( mrWindow, kWindowContentRgn, &maFullScreenRect ); + ChangeWindowAttributes( mrWindow, maFullScreenAttr, kWindowNoAttributes ); + SetSystemUIMode( kUIModeNormal, nil ); + } } // -----------------------------------------------------------------------