You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MacOS setting an ActivationPolicy prevent LSUIElement and LSBackground from functioning via editing Info.plist #261
Hi, I'm trying to hide dock icon for my mac application. According to this,
I should set LSUIElement in Info.plist to true, and it should work, but it is not.
Setting LSUIElement and LSBackground in Info.plist are both useless for winit apps.
Further investigation, revealed that winit set ActivationPolicy to regular on start. Hence dock icon is shown. Maybe it should leave it at its default?
I tried that approach. It works fine for packaged mac apps. (dock icon is hidden when LSUIElement is true, shown otherwise). Only dock icon is not shown when it's launched as unpackaged executable. Maybe we should give user an oppotunity to bypass this setActivationPolicy call?
Closing since there hasn't been any discussion on this and it seems that with_activation_policy would indeed solve this issue. If that isn't an accurate assessment of this, please feel free to re-open this for further discussion.
Closing since there hasn't been any discussion on this and it seems that with_activation_policy would indeed solve this issue. If that isn't an accurate assessment of this, please feel free to re-open this for further discussion.
I think there is still some value to this issue. A user of an application that uses winit should still be able to set LSUIElement to get their desired behavior, versus having to ask each application developer to pipe the config through. I think it makes sense that winit should honor what's in the package manifest, unless the application is explicitly setting activation_policy on top of that. I'm willing to do some work to get a patch, if this approach is acceptable.
I agree that we should try to honour the package manifest, though probably only if the implementation is reasonably simple (i.e. I don't really want Winit to try to read the bundle information, but if just avoiding calling setActivationPolicy is enough, then it'd be fine).
We are also looking into hiding the process from the dock. We are using notan which uses winit under the hood so once support is available in winit we'd have to add that functionally to notan.
FWIW We also tried setting it at runtime via FFI but it didn't work because I believe you can't do it when the window is already created?
Activity
francesca64 commentedon May 15, 2018
Is this covered by
os::macos::WindowBuilderExt::with_activation_policy?Osspial commentedon Apr 24, 2019
Closing since there hasn't been any discussion on this and it seems that
with_activation_policywould indeed solve this issue. If that isn't an accurate assessment of this, please feel free to re-open this for further discussion.Transition the existing postprocessing system to a layers system.
Merge next back to dev branch (rust-windowing#305)
purajit commentedon Sep 12, 2024
I think there is still some value to this issue. A user of an application that uses
winitshould still be able to set LSUIElement to get their desired behavior, versus having to ask each application developer to pipe the config through. I think it makes sense that winit should honor what's in the package manifest, unless the application is explicitly settingactivation_policyon top of that. I'm willing to do some work to get a patch, if this approach is acceptable.madsmtm commentedon Sep 12, 2024
I agree that we should try to honour the package manifest, though probably only if the implementation is reasonably simple (i.e. I don't really want Winit to try to read the bundle information, but if just avoiding calling
setActivationPolicyis enough, then it'd be fine).purajit commentedon Sep 12, 2024
Gotcha. I'll try to do some quick checks this weekend to see. Hopefully "only call
setActivationPolicyif explicitly asked" works.And thanks for responding to my comment on a 5-year-old discussion!
Hacksore commentedon Sep 13, 2024
We are also looking into hiding the process from the dock. We are using notan which uses winit under the hood so once support is available in winit we'd have to add that functionally to notan.
FWIW We also tried setting it at runtime via FFI but it didn't work because I believe you can't do it when the window is already created?
purajit commentedon Sep 16, 2024
Not setting it worked! Going to see how to best implement this.