FancyWM / fancywm

FancyWM - Dynamic Tiling Window Manager for Windows
GNU General Public License v2.0
737 stars 27 forks source link

Collision of shortcuts: System.Runtime.InteropServices.COMException: Element not found. (0x8002802B (TYPE_E_ELEMENTNOTFOUND)) #279

Open JokeUrSelf opened 3 months ago

JokeUrSelf commented 3 months ago

Hello, quickly want to thank for your job. This window manager is actually really really good. Now back to the problem So what I was trying to do, is to set shortcuts Win+1, Win+2... to switch between desktops and Shift + Win + 1, Shift + Win + 2... to move a window to a certain desktop. When I pressed Shift + Win + 2 while being focused on a certain window, this error appeared.

Observing the following error:

System.Runtime.InteropServices.COMException (0x8002802B): Element not found. (0x8002802B (TYPE_E_ELEMENTNOTFOUND))
   at WinMan.Windows.Com.IComApplicationViewCollection.GetViewForHwnd(IntPtr hwnd, IComApplicationView& view)
   at WinMan.Windows.Win32VirtualDesktopService17661.MoveToDesktop(IntPtr hWnd, Desktop desktop)
   at WinMan.Windows.FaultTolerantWin32VirtualDesktopService.<>c__DisplayClass16_0.<MoveToDesktop>b__0()
   at WinMan.Windows.FaultTolerantWin32VirtualDesktopService.ExecuteWithRetry(Action action)
   at WinMan.Windows.FaultTolerantWin32VirtualDesktopService.MoveToDesktop(IntPtr hWnd, Desktop desktop)
   at WinMan.Windows.Win32VirtualDesktop.MoveWindow(IWindow window)
   at FancyWM.MainWindow.OnMoveToDesktopHotkeyPressed(Int32 desktopIndex)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_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 ---
   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 FancyWM.Startup.AppMain(String[] args)
   at FancyWM.Startup.Main(String[] args)

To Reproduce Steps to reproduce the behavior: Described above

Expected behavior Moving a window to a corresponding desktop.

Desktop (please complete the following information):