浏览代码

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 年之前
父节点
当前提交
a705f546bb
共有 1 个文件被更改,包括 4 次插入2 次删除
  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;