mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Stop calling NSApplication.finishLaunching on window creation (#1902)
This is called internally by NSApplication.run, and is not something we should call - I couldn't find the reasoning behind this being there in the first place, git blame reveals c38110cac from 2014, so probably a piece of legacy code.
Removing this fixes creating new windows when you have assigned a main menu to the application.
This commit is contained in:
@@ -100,13 +100,13 @@ fn create_app(activation_policy: ActivationPolicy) -> Option<id> {
|
||||
if ns_app == nil {
|
||||
None
|
||||
} else {
|
||||
// TODO: Move ActivationPolicy from an attribute on the window to something on the EventLoop
|
||||
use self::NSApplicationActivationPolicy::*;
|
||||
ns_app.setActivationPolicy_(match activation_policy {
|
||||
ActivationPolicy::Regular => NSApplicationActivationPolicyRegular,
|
||||
ActivationPolicy::Accessory => NSApplicationActivationPolicyAccessory,
|
||||
ActivationPolicy::Prohibited => NSApplicationActivationPolicyProhibited,
|
||||
});
|
||||
ns_app.finishLaunching();
|
||||
Some(ns_app)
|
||||
}
|
||||
}
|
||||
@@ -357,6 +357,7 @@ impl UnownedWindow {
|
||||
panic!("Windows can only be created on the main thread on macOS");
|
||||
}
|
||||
}
|
||||
trace!("Creating new window");
|
||||
|
||||
let pool = unsafe { NSAutoreleasePool::new(nil) };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user