I have a MacOS application which displays a NSStatusItem with a custom view, implemented in SwiftUI. I noticed some rather terrible performance problems, however only when I am using some specific wallpapers.
I've made a super small Xcode project - https://github.com/nmcdonaldd/StatusItemCACommitCycle demoing the behavior. In that repo, I've also linked a YouTube video demoing the behavior (can't post video link here for some reason).
With one wallpaper, Instruments Time Profile is showing little-to-no weight in any CA-related traces. However, as soon as I change the wallpaper, Instruments is reporting a huge increase in CA::Transaction::commit(). After updating the wallpaper, Core Animation commit graph in instruments is showing hundreds of commits per second. When I switch it back to the first wallpaper, it stops. Also interesting - as soon as I switch the wallpaper, Instruments Time Profiler is reporting my application to be out of "Initializing" state and now into "Foreground".
Is this a bug or something I, as a developer, can prevent? Furthermore, how would a wallpaper change the state of my application?