cirruslabs / tart

macOS and Linux VMs on Apple Silicon to use in CI and other automations
https://tart.run
Other
3.76k stars 106 forks source link

Properly enter main even loop in headless mode #651

Closed fkorotkov closed 10 months ago

fkorotkov commented 10 months ago

Fixes #638

edigaryev commented 10 months ago

How you were able to validate this? Because for me even when running Tart 2.2.1 installed via Homebrew there's no icon jumping in Docker on macOS Sonoma 14.1 (I'm running ghcr.io/cirruslabs/ubuntu:latest, though, will try macOS shortly).

Also, it would be nice to explain a bit on why this is the proper way of entering the main event loop and why it results in no icon jumping in Dock.

fkorotkov commented 10 months ago

I reproduced with tart run --no-graphics sonoma-xcode, checked dispatchMain documentation which mentioned NSApplicationMain. Then I googled a bit and found another mention of the Application main loop on StackOverflow.

Made this change, ran it locally and didn't see the bouncing box. Also tested that Control+C works as expected.