[vlc-commits] macosx/main: lazy load main menu and library window controller

Felix Paul Kühne git at videolan.org
Sun Jun 16 13:50:06 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sun Jun 16 13:29:18 2019 +0200| [3b5314faead54f94696b016d31006bbcf33ccef6] | committer: Felix Paul Kühne

macosx/main: lazy load main menu and library window controller

This improves launch speed of the macOS interface module by up to 20%

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3b5314faead54f94696b016d31006bbcf33ccef6
---

 modules/gui/macosx/main/VLCMain.m | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/main/VLCMain.m b/modules/gui/macosx/main/VLCMain.m
index cdd90699f4..fb3e215462 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -151,9 +151,6 @@ int OpenIntf (vlc_object_t *p_this)
             [VLCApplication sharedApplication];
             [VLCMain sharedInstance];
 
-            [[NSBundle mainBundle] loadNibNamed:@"MainMenu" owner:[[VLCMain sharedInstance] mainMenu] topLevelObjects:nil];
-            [[[VLCMain sharedInstance] libraryWindow] makeKeyAndOrderFront:nil];
-
             msg_Dbg(p_intf, "Finished loading macosx interface");
             return VLC_SUCCESS;
         } @catch (NSException *exception) {
@@ -233,7 +230,7 @@ static VLCMain *sharedInstance = nil;
         _coredialogs = [[VLCCoreDialogProvider alloc] init];
 
         _mainmenu = [[VLCMainMenu alloc] init];
-        _statusBarIcon = [[VLCStatusBarIcon  alloc] init];
+        _statusBarIcon = [[VLCStatusBarIcon alloc] init];
 
         _voutProvider = [[VLCVideoOutputProvider alloc] init];
 
@@ -272,6 +269,8 @@ static VLCMain *sharedInstance = nil;
 {
     _clickerManager = [[VLCClickerManager alloc] init];
 
+    [[NSBundle mainBundle] loadNibNamed:@"MainMenu" owner:_mainmenu topLevelObjects:nil];
+
 #ifdef HAVE_SPARKLE
     [[SUUpdater sharedUpdater] setDelegate:self];
 #endif
@@ -280,6 +279,7 @@ static VLCMain *sharedInstance = nil;
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
 {
     launched = YES;
+    [_libraryWindowController.window makeKeyAndOrderFront:nil];
 
     if (!p_intf)
         return;



More information about the vlc-commits mailing list