SpriteKit animations freeze in second window on second display on Apple Silicon

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:

  1. Create a new macOS project in Xcode.
  2. Select the sample Game project with SpriteKit as the technology.
  3. Edit the fade duration in GameScene.swift to make the animated nodes live longer (e.g. 15 seconds).
  4. In AppDelegate.applicationDidFinishLaunching, add code to instantiate a second window:
        let mainStoryboard = NSStoryboard.init(name: NSStoryboard.Name("Main"), bundle: nil)
        if let newWindow = mainStoryboard.instantiateInitialController() as? NSWindowController {
            newWindow.showWindow(self)
        }

  1. Run the app. If both windows are on the same desktop, animations run correctly. If the windows are on separate desktops, then animations halt on the 1080p desktop, even though the SKView reports full frame rate.

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.

Answered by sv_lane in 778065022

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, however, I still consider this a bug that Apple needs to fix.

Accepted Answer

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, however, I still consider this a bug that Apple needs to fix.

SpriteKit animations freeze in second window on second display on Apple Silicon
 
 
Q