Parcourir la source

Enable resizing during fullscreen transition.

macOS seems to tie resizing of the NSView inside the window to the resizable style mask of the window somehow. If we programmatically transition a non-resizable window to fullscreen, the inner NSView's size isn't changed, so we need to make the window resizable during the fullscreen transition.

Makes the final two failing `WindowState` integration tests pass.
Steven Kirk il y a 2 ans
Parent
commit
a705f546bb
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      native/Avalonia.Native/src/OSX/WindowImpl.mm

+ 4 - 2
native/Avalonia.Native/src/OSX/WindowImpl.mm

@@ -146,11 +146,13 @@ bool WindowImpl::CanBecomeKeyWindow()
 
 void WindowImpl::StartStateTransition() {
     _transitioningWindowState = true;
+    UpdateStyle();
 }
 
 void WindowImpl::EndStateTransition() {
     _transitioningWindowState = false;
-    
+    UpdateStyle();
+
     // Ensure correct order of child windows after fullscreen transition.
     BringToFront();
 }
@@ -573,7 +575,7 @@ NSWindowStyleMask WindowImpl::CalculateStyleMask() {
         case SystemDecorationsFull:
             s = s | NSWindowStyleMaskTitled | NSWindowStyleMaskClosable;
 
-            if (_canResize && _isEnabled) {
+            if ((_canResize && _isEnabled) || _transitioningWindowState) {
                 s = s | NSWindowStyleMaskResizable;
             }
             break;