[BUG] - Alt + drag icon reordering only works when dropping the dragged shortcut directly onto another shortcut
If the drop target is any empty space inside the frame the icon does not reorder/move correctly. Repeated attempts after failed drops can eventually crash with an unhandled System.NullReferenceException from WPF UI Automation (ItemAutomationPeer.GetNameCore()).
CoreCLR Version: 8.0.2325.60607
.NET Version: 8.0.23
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Automation.Peers.ItemAutomationPeer.GetNameCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at DeskFrame.App.Main()
To Reproduce
-
Create/open a DeskFrame frame containing multiple shortcuts (Grid view). Make sure the frame is a little wider or taller in a direction to test the empty space
-
Hold Alt and start dragging any shortcut within the frame.
-
Try dropping the shortcut into empty space within the frame (not directly over another shortcut), e.g.:
- before the first icon
- after the last icon
- between icons where there is visible gap/space
- anywhere inside the frame background/padding
-
Observe reorder does not occur as expected (a reload fixes this condition I've noticed).
-
Keep attempting to move other icons after these failed drops; after several attempts DeskFrame may crash.
Expected behavior
Alt+drag reorder should allow dropping to any position in the grid, including empty spaces/slots within the frame, not only when the cursor is over another shortcut. Specifically my expectation is dragging an icon to the start or end of the list should work. DeskFrame should not crash regardless of repeated reorder attempts.
Screenshots / Screenrecording
Desktop (please complete the following information):
- OS Version W11 25H2
Additional context Details about your setup here such as number of monitors, scaling settings, whether you're using any other software that changes the look of windows, or how it functions.
Fixed!