vcl/osx/salframe.cxx    |   12 ++++++++++--
 vcl/osx/salframeview.mm |    9 ++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit 6dd8de16f20be7d7e4e4581ef303a44b480dd5cb
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Sun Mar 9 20:26:07 2025 -0400
Commit:     Patrick Luby <guibomac...@gmail.com>
CommitDate: Mon Mar 10 14:25:21 2025 +0100

    tdf#128186 use non-full screen values for native full screen windows
    
    Also, ensure that restore rectangles are in VCL coordinates.
    
    Change-Id: I9c5d15b2217ec3804d1a6c365b3e0c71b054c143
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182704
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 23816d236c82..df9d2b28d3fd 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -794,7 +794,8 @@ bool AquaSalFrame::GetWindowState(vcl::WindowData* pState)
 
         pState->rMask() |= vcl::WindowDataMask::MaximizedX | 
vcl::WindowDataMask::MaximizedY | vcl::WindowDataMask::MaximizedWidth | 
vcl::WindowDataMask::MaximizedHeight;
 
-        pState->setState(vcl::WindowState::Maximized);
+        // tdf#128186 use non-full screen values for native full screen windows
+        pState->setState(vcl::WindowState::Normal);
     }
     else
     {
@@ -948,9 +949,16 @@ void AquaSalFrame::doShowFullScreen( bool bFullScreen, 
sal_Int32 nDisplay )
         }
 
         if( mbNativeFullScreen && !NSIsEmptyRect( 
maNativeFullScreenRestoreRect ) )
+        {
             maInternalFullScreenRestoreRect = maNativeFullScreenRestoreRect;
+        }
         else
-            maInternalFullScreenRestoreRect = [mpNSWindow frame];
+        {
+            // Related: tdf#128186 restore rectangles are in VCL coordinates
+            NSRect aFrame = [mpNSWindow frame];
+            CocoaToVCL( aFrame );
+            maInternalFullScreenRestoreRect = aFrame;
+        }
 
         // Related: tdf#161623 do not add the window's titlebar height
         // to the window's frame as that will cause the titlebar to be
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 027676c97407..2f8d0f2a6104 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -656,9 +656,16 @@ static void updateMenuBarVisibility( const AquaSalFrame 
*pFrame )
         mpFrame->mbNativeFullScreen = true;
 
         if( mpFrame->mbInternalFullScreen && !NSIsEmptyRect( 
mpFrame->maInternalFullScreenRestoreRect ) )
+        {
             mpFrame->maNativeFullScreenRestoreRect = 
mpFrame->maInternalFullScreenRestoreRect;
+        }
         else
-            mpFrame->maNativeFullScreenRestoreRect = [mpFrame->getNSWindow() 
frame];
+        {
+            // Related: tdf#128186 restore rectangles are in VCL coordinates
+            NSRect aFrame = [mpFrame->getNSWindow() frame];
+            mpFrame->CocoaToVCL( aFrame );
+            mpFrame->maNativeFullScreenRestoreRect = aFrame;
+        }
 
         updateMenuBarVisibility( mpFrame );
     }

Reply via email to