microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.4k stars 6.56k forks source link

[FZ editor] crash when double click in `edit layout` button #10571

Closed LuanVSO closed 3 years ago

LuanVSO commented 3 years ago

Microsoft PowerToys version

0.35.0

Running as admin

Yes

Area(s) with issue?

FancyZones Editor

Other Software

No response

Steps to reproduce

my mouse is with double click, so when i click 1 time it does an extremely fast double click. so:

  1. open fz editor
  2. click the edit layout button
  3. crash

my mouse is able to click the button 2 times before the new window even has a chance to come up

✔️ Expected Behavior

not to crash

❌ Actual Behavior

crash

contents of fzeditorcrash.log:

Exception

System.ArgumentException: The visual specified is already a child of another Visual or root CompositionTarget.
   Source: PresentationCore
   TargetAssembly: PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: PresentationCore.dll
   TargetSite: Void Insert(Int32, System.Windows.Media.Visual)
   at System.Windows.Media.VisualCollection.Insert(Int32 index, Visual visual)
   at System.Windows.Documents.AdornerLayer.AddAdornerToVisualTree(AdornerInfo adornerInfo, Int32 zOrder)
   at System.Windows.Documents.AdornerLayer.Add(Adorner adorner, Int32 zOrder)
   at System.Windows.Documents.AdornerLayer.Add(Adorner adorner)
   at ModernWpf.Controls.ContentDialog.ShowAsync()
   at FancyZonesEditor.MainWindow.EditLayout_Click(Object sender, RoutedEventArgs e)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   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 where exception was thrown ---
   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 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   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.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at FancyZonesEditor.App.Main()

Environment

dedavis6797 commented 3 years ago

Resolved with the release of v0.45.