1
0
Эх сурвалжийг харах

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 2 жил өмнө
parent
commit
a705f546bb

+ 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;