You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[macOS] Quitting the app does not raise AppWindow.Closing or Window.Closed #26075
On the macOS desktop target, quitting the app with Cmd+Q, the application menu's Quit or the Dock's Quit ends it at once: AppWindow.Closing and Window.Closed are not raised. An app cannot cancel the quit (for example to ask about unsaved work), and work it does when its window closes does not run.
Closing the window with its close button raises both events, so the two ways of leaving the app behave differently.
Expected behavior 🎯
Quitting the app closes its windows as the user would: each window raises AppWindow.Closing, which can cancel the quit, and then Window.Closed.
How to reproduce it (as minimally and precisely as possible) 🔬
Create an Uno Platform app with the desktop target and run it on macOS.
On the main window, handle AppWindow.Closing (set args.Cancel = true) and Window.Closed, logging each.
Press Cmd+Q, or use the application menu's Quit or the Dock's Quit.
The app exits, and neither handler runs.
Workaround 🛠️
None from app code: the macOS host answers the quit in applicationShouldTerminate: before the app is involved.
Affected platforms 📱💻🖥️
Desktop (macOS)
Uno.Sdk version (and other relevant versions) 📦
Uno Platform master (7.1-dev).
IDE version 🧑💻
No response
Anything else we need to know? 💬
Found in an app that runs its shutdown work when its window closes. A fix is proposed in #26063.
Activity