Repository navigation
fix: Fully drop macOS SubclassingAdapter if KVO is detected - #835
Conversation
|
For the reference, I think it is the same issue we have worked around on the app side in the Godot engine some time ago (I assumed it to be OS bug) - godotengine/godot#105804 |
|
Thanks @bruvzg, I might have looked into this earlier had I come across this Godot issue. Any chance Godot can use the regular macOS, Windows and iOS adapters in the future? Such issues are a direct consequence of the hacks we have to use to make this work and it would be better to get rid of them. |
We definitely will remove this hack as soon as we are updating to a new AccessKit version. Tested removing it. I can still reproduce the crash with 0.23.1, and can confirm this PR fixes it. Only tested on macOS 15 VM with TouchBar-Simulator, since I do not have any Mac with touch bar (and simulator stopped working in macOS 27). |
Closes #823
Unfortunately for us, macOS can sometime subclass views which then make our subclassing adapter drop implementation crash the application. One common cause is with machines that have a touch bar. The best we can do is ensure we free the adapter but don't touch the view class. Our class object will be deallocated with the view. Similarly we can't subclass a view if it is already observed, this should never happen with winit but we can't be sure and that is a limitation of the subclassing adapter.
Also introduces a testing framework for integration tests that must run on the main thread.