vlc/vlc-2.2 | branch: master | David Fuhrmann <[email protected]> | Sat Jun 20 11:46:08 2015 +0200| [8580313e6685e9ed1748484a827cdeba7197444e] | committer: David Fuhrmann
macosx: fix window ordering during startup (close #14486) According to docu, application:willFinishLaunching: will be called as one of the first steps of [NSApp run], before the main loop will be actually started. Thus, it should make no performance difference if we load the main window already in run(). For some unknown reasons, a direct call to makeKeyAndOrderFront works in run(), but not in app:willFinishLaunching:, though. > http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=8580313e6685e9ed1748484a827cdeba7197444e --- modules/gui/macosx/intf.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 05779af..132110a 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -331,6 +331,9 @@ static void Run(intf_thread_t *p_intf) [NSBundle loadNibNamed: @"MainMenu" owner: NSApp]; + [NSBundle loadNibNamed:@"MainWindow" owner: [VLCMain sharedInstance]]; + [[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil]; + [NSApp run]; msg_Dbg(p_intf, "Run loop has been stopped"); [[VLCMain sharedInstance] applicationWillTerminate:nil]; @@ -782,12 +785,6 @@ static VLCMain *_o_sharedMainInstance = nil; items_at_launch = p_playlist->p_local_category->i_children; PL_UNLOCK; - [NSBundle loadNibNamed:@"MainWindow" owner: self]; - - // This cannot be called directly here, as the main loop is not running yet so it would have no effect. - // So lets enqueue it into the loop for later execution. - [o_mainwindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0]; - [[SUUpdater sharedUpdater] setDelegate:self]; } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
