mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-02-02 14:56:34 +11: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:
parent
ba704c4eb4
commit
629cd86c7c
2 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- On macOS, fix creating new windows when the application has a main menu.
|
||||||
- On Windows, fix fractional deltas for mouse wheel device events.
|
- On Windows, fix fractional deltas for mouse wheel device events.
|
||||||
- On macOS, fix segmentation fault after dropping the main window.
|
- On macOS, fix segmentation fault after dropping the main window.
|
||||||
- On Android, `InputEvent::KeyEvent` is partially implemented providing the key scancode.
|
- On Android, `InputEvent::KeyEvent` is partially implemented providing the key scancode.
|
||||||
|
|
|
@ -100,13 +100,13 @@ fn create_app(activation_policy: ActivationPolicy) -> Option<id> {
|
||||||
if ns_app == nil {
|
if ns_app == nil {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
// TODO: Move ActivationPolicy from an attribute on the window to something on the EventLoop
|
||||||
use self::NSApplicationActivationPolicy::*;
|
use self::NSApplicationActivationPolicy::*;
|
||||||
ns_app.setActivationPolicy_(match activation_policy {
|
ns_app.setActivationPolicy_(match activation_policy {
|
||||||
ActivationPolicy::Regular => NSApplicationActivationPolicyRegular,
|
ActivationPolicy::Regular => NSApplicationActivationPolicyRegular,
|
||||||
ActivationPolicy::Accessory => NSApplicationActivationPolicyAccessory,
|
ActivationPolicy::Accessory => NSApplicationActivationPolicyAccessory,
|
||||||
ActivationPolicy::Prohibited => NSApplicationActivationPolicyProhibited,
|
ActivationPolicy::Prohibited => NSApplicationActivationPolicyProhibited,
|
||||||
});
|
});
|
||||||
ns_app.finishLaunching();
|
|
||||||
Some(ns_app)
|
Some(ns_app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -357,6 +357,7 @@ impl UnownedWindow {
|
||||||
panic!("Windows can only be created on the main thread on macOS");
|
panic!("Windows can only be created on the main thread on macOS");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
trace!("Creating new window");
|
||||||
|
|
||||||
let pool = unsafe { NSAutoreleasePool::new(nil) };
|
let pool = unsafe { NSAutoreleasePool::new(nil) };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue