diff options
-rw-r--r-- | vcl/aqua/source/window/salframe.cxx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index ce4370c57b9f..4530778c5775 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -578,12 +578,27 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) VCLToCocoa( aStateRect ); aStateRect = [NSWindow frameRectForContentRect: aStateRect styleMask: mnStyleMask]; - // relase and acquire mutex again since this call can block waiting for an internal lock + [mpWindow setFrame: aStateRect display: NO]; + if( pState->mnState == SAL_FRAMESTATE_MINIMIZED ) + [mpWindow miniaturize: NSApp]; + else if( [mpWindow isMiniaturized] ) + [mpWindow deminiaturize: NSApp]; + + + /* ZOOMED is not really maximized (actually it toggles between a user set size and + the program specified one), but comes closest since the default behavior is + "maximized" if the user did not intervene + */ + if( pState->mnState == SAL_FRAMESTATE_MAXIMIZED ) { - [mpWindow setFrame: aStateRect display: NO]; + if(! [mpWindow isZoomed]) + [mpWindow zoom: NSApp]; + } + else + { + if( [mpWindow isZoomed] ) + [mpWindow zoom: NSApp]; } - - // FIXME: HTH maximized state ? // get new geometry UpdateFrameGeometry(); @@ -641,8 +656,6 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState ) pState->mnWidth = long(aStateRect.size.width); pState->mnHeight = long(aStateRect.size.height); - // FIXME: HTH maximized state ? - if( [mpWindow isMiniaturized] ) pState->mnState = SAL_FRAMESTATE_MINIMIZED; else if( ! [mpWindow isZoomed] ) |