elementary / portals

https://elementary.io
GNU General Public License v3.0
23 stars 6 forks source link

Respect user autostart options #89

Closed leolost2605 closed 1 year ago

leolost2605 commented 1 year ago

Currently disabling autostart for an app like mail via startup settings gets reverted every time the app is launched again because the app then asks for autostart permission again and the autostart file is entirely overwritten. To disable it one would have to revoke the flatpak permission which currently can't be done graphically without third party tools. Also this wouldn't work for non flatpak applications. With this PR we check whether an autostart file already exists and if so we check whether it has the hidden key and add it to the new autostart file. We still overwrite it completely to avoid keeping other keys we might not want (I'm not 100% sure whether that's really necessary but it seems the most save way)

Marukesu commented 1 year ago

It would be simpler to load the contents directly in the key_file when it already exists. There's no need to worry about keeping others keys.

leolost2605 commented 1 year ago

@Marukesu done.