Browse Source

Merge pull request #9376 from AvaloniaUI/fixes/macos-multi-window-freeze

[OSX] Fixed multi-window freeze on Show when another window is rendering
Max Katz 3 years ago
parent
commit
186faca206
1 changed files with 4 additions and 1 deletions
  1. 4 1
      native/Avalonia.Native/src/OSX/rendertarget.mm

+ 4 - 1
native/Avalonia.Native/src/OSX/rendertarget.mm

@@ -183,8 +183,11 @@ static IAvnGlSurfaceRenderTarget* CreateGlRenderTarget(IOSurfaceRenderTarget* ta
                 [_layer setContents: (__bridge IOSurface*) surface->surface];
             }
             [CATransaction commit];
-            [CATransaction flush];
         }
+        // This can trigger event processing on the main thread
+        // which might need to lock the renderer
+        // which can cause a deadlock. So flush call is outside of the lock
+        [CATransaction flush];
     }
     else
         dispatch_async(dispatch_get_main_queue(), ^{