Commit 9434662c authored by David Fuhrmann's avatar 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 openIntf().

For some unknown reasons, a direct call to makeKeyAndOrderFront
works in run(), but not in app:willFinishLaunching:, though.
parent cc07bce0
...@@ -132,6 +132,9 @@ int OpenIntf (vlc_object_t *p_this) ...@@ -132,6 +132,9 @@ int OpenIntf (vlc_object_t *p_this)
[NSBundle loadNibNamed: @"MainMenu" owner: NSApp]; [NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
[NSBundle loadNibNamed:@"MainWindow" owner: [VLCMain sharedInstance]];
[[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
[o_pool release]; [o_pool release];
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -769,12 +772,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -769,12 +772,6 @@ static VLCMain *_o_sharedMainInstance = nil;
items_at_launch = p_playlist->p_local_category->i_children; items_at_launch = p_playlist->p_local_category->i_children;
PL_UNLOCK; 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];
#ifdef HAVE_SPARKLE #ifdef HAVE_SPARKLE
[[SUUpdater sharedUpdater] setDelegate:self]; [[SUUpdater sharedUpdater] setDelegate:self];
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment