We have a 2023 Mac mini with an Apple M2 Pro chip. The Mac has two displays connected. If a SpriteKit application has two windows on separate desktops, one of the windows can’t run animations.
You can easily replicate this issue with the following steps:
let mainStoryboard = NSStoryboard.init(name: NSStoryboard.Name("Main"), bundle: nil)
if let newWindow = mainStoryboard.instantiateInitialController() as? NSWindowController {
newWindow.showWindow(self)
}
You can also just check out the sample project from my github repo: https://github.com/lanephillips/SKTest
The issue does not occur if the application is built for Intel processors only and run on Apple Silicon under Rosetta.
We've seen this issue occur in both macOS 13 and 14. I've filed a report through Feedback Assistant, but I'm posting here in case someone else has seen this and has a workaround.
I discovered today that if both displays are set to the same refresh rate then the bug does not occur. This is an acceptable workaround for us.
I'm guessing that SpriteKit matches its own frame rate to one of the displays. If the rate for the other display doesn't match, then SpriteKit just gives up. I anticipate this is an "optimization" that Apple is going to flag as WONTFIX. It's strange, though, that this runs better as an Intel build on Rosetta.