Repository navigation
Conversation
Dropping a Window closed it straight away. On Touch Bar Macs AppKit then threw an NSRangeException in the next display-cycle flush, from -[_NSTouchBarFinderObservation invalidate], because the view it observed for nextResponder had already been unregistered. An application that catches the exception in its run loop kept going, but the Core Animation transaction was cut short and the closed window stayed on screen. Resign the first responder while the view still exists, order the window out and flush the Core Animation transaction before closing, so the window leaves the screen whatever the display cycle does afterwards.
3 tasks done
This branch has not been deployed
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.
Backport of #4728 to the 0.30 maintenance branch, where eframe/egui and many other applications still are.
On Macs with a Touch Bar, dropping a
Windowcalls-[NSWindow close], and in the next display-cycle flush AppKit throwsNSRangeException: Cannot remove an observer <_NSTouchBarFinderObservation> for the key path "nextResponder" from <WinitView> because it is not registered as an observer.An application that catches the exception keeps running, but the Core Animation transaction is cut short and the closed window stays on screen. Reported against an Intel MacBookPro16,1 on macOS 26 (crmne/zapfast#260).Before closing,
Window::dropnow clears the window's first responder, orders the window out, and flushes the currentCATransaction(looked up at runtime, no new dependency), then callsclose()as before. Each step is harmless on Macs without a Touch Bar.Checked with
cargo clippy --target aarch64-apple-darwin --all-targets -D warnings; the master version was run on an arm64 Mac without a Touch Bar. Draft until it is confirmed on Touch Bar hardware. CI on v0.30.x fails before compiling (synis ambiguous, see #4692).changelogmodule