Skip to content

[Run] Crash (COMException) when trying drag and drop when other DnD is already in progress #31301

@FWest98

Description

@FWest98

Microsoft PowerToys version

0.77.0.0

Installation method

GitHub

Running as admin

No

Area(s) with issue?

PowerToys Run

Steps to reproduce

  • Start a lengthy drag-n-drop process; for example by extracting a big zip in winrar by dragging the contents to another folder
  • Open PT Run, search for a file
  • Try to drag-n-drop that file to anywhere

Exception + tracelog:

System.Runtime.InteropServices.COMException: A drag operation is already in progress

   Source: 
   TargetAssembly: WindowsBase, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: WindowsBase.dll
   TargetSite: Void DoDragDrop(System.Runtime.InteropServices.ComTypes.IDataObject, IOleDropSource, Int32, Int32[])
   at MS.Win32.UnsafeNativeMethods.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
   at System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
   at System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObject dataObject, DragDropEffects allowedEffects)
   at System.Windows.DragDrop.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects)
   at PowerLauncher.MainWindow.SuggestionsList_MouseMove(Object sender, MouseEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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)

✔️ Expected Behavior

I would expect the drag-drop to work, but I can imagine that might not be possible due to Windows constraints. But then at the very least I would expect PTRun to not crash (or even nicer - show a cross cursor or something to indicate you can't drag-drop)

❌ Actual Behavior

PTRun crashes

Other Software

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugSomething isn't workingPriority-1Bug that is high priorityProduct-PowerToys RunImproved app launch PT Run (Win+R) Window

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions