From d147bb5e7e8bfda63cbfbed310d0bbcf3f110614 Mon Sep 17 00:00:00 2001
From: David Fuhrmann <dfuhrmann@videolan.org>
Date: Wed, 16 Dec 2020 08:23:12 +0100
Subject: [PATCH] macosx: Fix animations in open panel

Open panel was showing only half of the tab view, because
the animation was interrupted right in the middle.

(manual bp of 12c8eb0c7f02b3bac3bd08ce07292183bf20d327)
---
 modules/gui/macosx/VLCOpenWindowController.m | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCOpenWindowController.m b/modules/gui/macosx/VLCOpenWindowController.m
index 994953a8b02f..57920bc09dd7 100644
--- a/modules/gui/macosx/VLCOpenWindowController.m
+++ b/modules/gui/macosx/VLCOpenWindowController.m
@@ -414,8 +414,11 @@ static NSString *kCaptureTabViewId  = @"capture";
     // load window
     [self window];
 
-    [_tabView selectTabViewItemWithIdentifier:identifier];
-    [_fileSubCheckbox setState: NSOffState];
+    // Delay this to allow the full animation to run inside the modal event loop
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [_tabView selectTabViewItemWithIdentifier:identifier];
+        [_fileSubCheckbox setState: NSOffState];
+    });
 
     int i_result = [NSApp runModalForWindow: self.window];
     [self.window close];
-- 
GitLab