rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.88k stars 913 forks source link

Prevent winit from overriding LSUIElement in package manifests #3920

Closed purajit closed 2 months ago

purajit commented 2 months ago

Fixes https://github.com/rust-windowing/winit/issues/261

Essentially, MacOS users of applications that use winit were unable to set LSUIElement in their package manifest to make the app behave as an agent app, even if the application itself wasn't enforcing anything. This was because winit was using a default value of ActivationPolicy:Regular if none was provided, overriding anything in the package manifest.

So, make with_activation_policy override package manifest only if explicitly specified.

See ActivationPolicy docs, LSUIElement docs.

Tested with a branch off of v0.30.4, since v0.30.5 (clean) breaks the build of the application I'm using.

purajit commented 2 months ago

@madsmtm addressed your comments, and thanks for the quick review! I've tested with a branch off of v0.30.4 since v0.30.5 (clean) breaks the application I'm testing it through. Do you think this is good enough? If not, I can try doing a test with the example tomorrow.

purajit commented 2 months ago

Awesome, thanks!