-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Ensure macOS apps pick up new icons after an update #1766
Conversation
FYI: I've seen something similar on Android, and I never discovered any workaround other than uninstalling and reinstalling the app. But I think it only affected the icon visible in the apps list in the launcher, not the running app itself. It's possible this has been fixed on newer Android versions. |
self.logger.warning( | ||
"Splash screens are now configured based on the icon. " | ||
"The splash configuration will be ignored." | ||
"\nSplash screens are now configured based on the icon. " | ||
"The splash configuration will be ignored.\n" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an FYI, as a consequence of str.splitlines()
in Log()
, a single trailing newline is effectively ignored. However, a trailing newline in the output text can be achieved with two trailing newlines in the string.
>>> "\nline of text\n".splitlines()
['', 'line of text']
>>> "\nline of text\n\n".splitlines()
['', 'line of text', '']
Same as the "extra" newline in the multiline strings.
>>> """line 1
... line 2
... line 3
...
... """
'line 1\nline 2\nline 3\n\n'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - I'd completely forgotten we'd made this change. I've cleaned this up in #1769.
It would be nice if there was a way to automate catching stylistic regressions like this, but I'm not sure I have any ideas on how we'd do that.
With the switch to Toga using the binary's icon at runtime, a new bug emerges - macOS caches app icons. When using the app template, and you change the app icon, the app bundle on the filesystem will be updated, but starting the app will show the old icon.
If you re-create the app, the new icon is displayed.
The cache key appears to be the modification time on the .app bundle itself; if you touch the bundle as part of an update, the new icon is loaded.
This didn't affect the Xcode template because every run is a new build, which implicitly touches the .app bundle.
This PR force touches the .app bundle on the macOS backends to ensure that the icon cache is busted.
Includes a coupe of cosmetic whitespace updates for good measure.
PR Checklist: