Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent winit from overriding LSUIElement in package manifests #3920

Conversation

purajit
Copy link
Contributor

@purajit purajit commented Sep 16, 2024

Fixes #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.

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with comments resolved, thanks!

src/platform/macos.rs Outdated Show resolved Hide resolved
src/platform/macos.rs Show resolved Hide resolved
@purajit
Copy link
Contributor Author

purajit commented Sep 16, 2024

@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 purajit marked this pull request as ready for review September 16, 2024 04:46
@madsmtm madsmtm added B - bug Dang, that shouldn't have happened DS - macos labels Sep 16, 2024
@madsmtm madsmtm added this to the Version 0.30.6 milestone Sep 16, 2024
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! And yeah, your testing is good enough.

src/platform/macos.rs Outdated Show resolved Hide resolved
@madsmtm madsmtm merged commit 7e819bb into rust-windowing:master Sep 16, 2024
58 checks passed
@purajit
Copy link
Contributor Author

purajit commented Sep 16, 2024

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - macos
Development

Successfully merging this pull request may close these issues.

MacOS setting an ActivationPolicy prevent LSUIElement and LSBackground from functioning via editing Info.plist
2 participants