Repository navigation
fix(macos): Close the windows through AppWindow.Closing when the app is asked to quit (backport #26063) - #26064
Merged
agneszitte merged 11 commits intoNov 9, 2026
Conversation
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26064/docs/index.html |
ajpinedam
marked this pull request as ready for review
November 5, 2026 11:07
1 of 3 tasks
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26064/docs/index.html |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
agneszitte
approved these changes
Nov 9, 2026
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: related to #26075, which #26063 closes on
masterPR Type:
🐞 Bugfix
What changed? 🚀
Manual
servicing/6.8backport of #26063, synced to its headbb777cabc6; this one is synced again if it changes. The same commits are backported torelease/stable/6.7in #26097.What it fixes (same as the
masterPR): on macOS, Cmd+Q, the application menu's Quit and the Dock's Quit end the app without raisingAppWindow.ClosingorWindow.Closed. Now:AppWindow.Closingfirst, which can cancel the quit, thenClosed. If one window cancels, the windows asked before it are closed; it and the windows behind it stay open.DispatcherShutdownModeis.OnExplicitShutdownstill keeps the app running after the user closes its last window, and a later Quit still ends it.ClosingorClosed, as before and as on Windows.Application.Exit()now matches WinUI'sFrameworkApplication::ExitImpl: it closes every window asWindow.Close()does, raisingWindow.Closedbut notAppWindow.Closing, then exits. AClosedhandler that setsHandledkeeps its window open, and withOnLastWindowClosethat keeps the app running.Closinghandler that throws logs an Error; a cancelled close andOnExplicitShutdownkeeping the app running log at Debug.doc/articles/features/app-close-handler.mdgains a macOS section, and the manual sampleWindowing/AppWindow_QuitClosesWindowscovers the scenarios.The behaviour changes and the manual test steps are in #26063.
Why not a Mergify backport: files moved for 7.0. On 6.8 the macOS host is
Uno.UI.Runtime.Skia.MacOS(notUno.UI.Runtime.MacOS), and the sample folder isMicrosoft_UI_Windowing(notMicrosoft/UI/Windowing). The commits apply unchanged otherwise: the net diff is line for line the same asmaster's.One 6.8 difference, now harmless: a closed window leaves the
windowsset only when it is deallocated, not when it closes. It is no longer visible, so a quit does not ask it.Validated on 6.8 with Studio Live, the downstream app that needs this (it runs its shutdown sequence when its window closes). The same change was applied to the Uno commit behind its
6.8.0-dev.187(91e6b404), and its macOS host (Uno.UI.Runtime.Skia.MacOS.dllandlibUnoNativeMac.dylib) swapped into the app's build output. Quits were sent as the Dock's quit request, on macOS 27, Apple silicon:Closing→ the app closes its window →Closed→ its sequence →Application.Exit()ends itkAEReallyLogOut)On this branch itself,
SamplesApp.Skia.Genericbuilds, and the sample logsClosing→Closed→ exit on a quit.The individual behaviours (cancel, front-to-back order, hidden windows, file picker, throwing handler,
OnExplicitShutdown,Exit()parity) were checked onmasterwith SamplesApp; see #26063.PR Checklist ✅