-
Notifications
You must be signed in to change notification settings - Fork 116
Drag & Drop TreeDataGrid item will crash on mac #387
Description
I extracted the code from TreeDataGridDemo to test drag & drop feature (see attached for the test project), but it will crash when start dragging on Mac OS (Version 15.2). The strange thing is that D&D has no problem in TreeDataGridDemo, it looks the DataObject for D&D is only valid inside the demo itself but not system wide.
AvaloniaApplication2.zip
Avalonia.Controls.TreeDataGrid/samples/AvaloniaApplication2/bin/Debug/net8.0/AvaloniaApplication2
2025-09-24 09:36:12.541 AvaloniaApplication2[92934:3258140] +[IMKClient subclass]: chose IMKClient_Modern
2025-09-24 09:36:12.541 AvaloniaApplication2[92934:3258140] +[IMKInputSession subclass]: chose IMKInputSession_Modern
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AvnView resetPressedMouseButtons]: unrecognized selector sent to instance 0x7ff28ff28150'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff8052ce326 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff804db3bd0 objc_exception_throw + 62
2 CoreFoundation 0x00007ff805375def -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00007ff80523e29f forwarding + 1379
4 CoreFoundation 0x00007ff80523dca8 _CF_forwarding_prep_0 + 120
5 libAvaloniaNative.dylib 0x00000001ab546b26 _ZN14WindowBaseImpl25BeginDragAndDropOperationE18AvnDragDropEffects8AvnPointP13IAvnClipboardP21IAvnDndResultCallbackPv + 784
6 ??? 0x000000010c1ad5df 0x0 + 4498052575
... ...
25 ??? 0x000000010bf8ad08 0x0 + 4495813896
26 libAvaloniaNative.dylib 0x00000001ab54c75b -[AvnView mouseEvent:withType:] + 1318
27 libAvaloniaNative.dylib 0x00000001ab54cee7 -[AvnView mouseDragged:] + 50
28 AppKit 0x00007ff8097de99d -[NSWindow _handleMouseDraggedEvent:] + 49
29 AppKit 0x00007ff808d0a2d1 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 301
30 AppKit 0x00007ff808d09f89 -[NSWindow(NSEventRouting) sendEvent:] + 339
31 libAvaloniaNative.dylib 0x00000001ab554512 -[AvnWindow sendEvent:] + 438
32 AppKit 0x00007ff80960338e -[NSApplication(NSEventRouting) sendEvent:] + 1546
33 libAvaloniaNative.dylib 0x00000001ab53069c -[AvnApplication sendEvent:] + 86
34 AppKit 0x00007ff8091702c3 -[NSApplication _handleEvent:] + 65
35 AppKit 0x00007ff808ba3575 -[NSApplication run] + 654
36 libAvaloniaNative.dylib 0x00000001ab535d74 _ZN26PlatformThreadingInterface7RunLoopEP20IAvnLoopCancellation + 626
37 ??? 0x000000010be1108c 0x0 + 4494266508
... ...
45 ??? 0x0000000109e6443b 0x0 + 4461052987
46 libcoreclr.dylib 0x0000000108342df1 CallDescrWorkerInternal + 124
47 libcoreclr.dylib 0x00000001081a2e53 _ZN18MethodDescCallSite16CallTargetWorkerEPKyPyi + 1587
48 libcoreclr.dylib 0x000000010809c5d8 _Z7RunMainP10MethodDescsPiPP8PtrArray + 712
49 libcoreclr.dylib 0x000000010809c9e2 _ZN8Assembly17ExecuteMainMethodEPP8PtrArrayi + 450
50 libcoreclr.dylib 0x00000001080c6dd1 _ZN8CorHost215ExecuteAssemblyEjPKDsiPS1_Pj + 689
51 libcoreclr.dylib 0x0000000108089bc2 coreclr_execute_assembly + 226
52 libhostpolicy.dylib 0x000000010798e56d _Z19run_app_for_contextRK20hostpolicy_context_tiPPKc + 2013
53 libhostpolicy.dylib 0x000000010798f4e4 corehost_main + 276
54 libhostfxr.dylib 0x00000001078aae35 _ZN10fx_muxer_t24handle_exec_host_commandERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERK19host_startup_info_tS8_RKNS0_13unordered_mapI13known_optionsNS0_6vectorIS6_NS4_IS6_E 55 libhostfxr.dylib 0x00000001078a9f41 _ZN10fx_muxer_t7executeENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPPKcRK19host_startup_info_tPciPi + 977
56 libhostfxr.dylib 0x00000001078a6c63 hostfxr_main_startupinfo + 131
57 AvaloniaApplication2 0x00000001077f8b07 _Z9exe_startiPPKc + 1655
58 AvaloniaApplication2 0x00000001077f8d6f main + 175
59 dyld 0x00007ff804de82cd start + 1805
)
libc++abi: terminating due to uncaught exception of type NSException
Process finished with exit code 134.