1. mst
  2. ooo340

Commits

Philipp Lohmann [pl]  committed a3f3376

vcl116: #i114476# implement maximize/minimize states in SetWindowSate

  • Participants
  • Parent commits 53bed2d
  • Branches default

Comments (0)

Files changed (1)

File vcl/aqua/source/window/salframe.cxx

View file
     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();
     
     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] )