lin-ycv / EverythingPowerToys

Everything search plugin for PowerToys Run
Eclipse Public License 2.0
2.21k stars 58 forks source link

[BUG] Dispatcher processing has been suspended, but messages are still being processed. #33

Closed daniel-richter closed 1 year ago

daniel-richter commented 1 year ago

Describe the bug For certain search queries the error message box ("System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.") appears. Depending on the query, there are a lot of error message windows that cause the whole system to freeze.

To Reproduce I could track it down to the following:

The strange thing is: I search (the first time) for "thesis.pdf" - the error message box appears; I close it. I search for "thesis.pdf" aggain - the error message does not appear, all search results are displayed correctly.

It feels like a error message is issued per PDF file in the search results. I am not sure if it is limited to PDF files only. I tried both Acrobat Preview Handler and Powertoys File Preview Handler for PDF. Edit: see next comment.

Screenshots Unbenannt2 (The big black rectangle is the shadow of 1241 error message windows...)

Logs (please upload or provide link to you log):

2022-11-29 15:28:00.6366] [WARN] [C:\a\_work\1\s\src\modules\launcher\PowerLauncher\Plugin\PluginManager.cs::207]
PluginManager.QueryForPlugin Window Walker. Query cost - 72 milliseconds

[2022-11-29 15:28:00.7650] [WARN] [C:\a\_work\1\s\src\modules\launcher\PowerLauncher\Plugin\PluginManager.cs::207]
PluginManager.QueryForPlugin Program. Query cost - 62 milliseconds

[2022-11-29 15:28:01.0765] [WARN] [C:\a\_work\1\s\src\modules\launcher\PowerLauncher\Plugin\PluginManager.cs::207]
PluginManager.QueryForPlugin Everything. Query cost - 311 milliseconds

[2022-11-29 15:28:01.3972] [FATAL]

## Exception

System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
   Source: WindowsBase
   TargetAssembly: WindowsBase, Version=6.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: WindowsBase.dll
   TargetSite: IntPtr WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   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)

## Environment
* Command Line: "C:\Program Files\PowerToys\modules\launcher\PowerToys.PowerLauncher.dll" -powerToysPid 10828 --started-from-runner
* Timestamp: 11/29/2022 15:28:01
* Wox version: 0.64.1.0
* OS Version: Microsoft Windows NT 10.0.19045.0
* IntPtr Length: 8
* x64: True
* CLR Version: 6.0.11
* Installed .NET Framework: 
   * v4 Client 4.8.04084
   * v4 Full 4.8.04084
   * v4.0 Client 4.0.0.0

Version (please provide the version of software you are using):

lin-ycv commented 1 year ago

Is the pdf an online (onedrive/Google drive/ drop box) file? Or a local file?

daniel-richter commented 1 year ago

It's a local file.

I tried both Acrobat Preview Handler and Powertoys File Preview Handler for PDF.

Hm, I just realized that I didn't have PowerToy's Icon Preview enabled, but just the Preview Pane. After enabling "PDF thumbnails" in PowerToys File Explorer extensions, the problem is gone.

But in general: The actual thumbnail generation is not the responsibility of the Everything plugin but of the Powertoys launcher, right?

lin-ycv commented 1 year ago

Yes, for preview option, the plugin simply tells PowerToys to fetch it from the file, PowerToys then decides how to fetch it. Good to know you've solved it, seems like there's nothing for me to do here, closing the issue for now.

lin-ycv commented 1 year ago

Related to https://github.com/microsoft/PowerToys/issues/18166

jaimecbernardo commented 1 year ago

For any users that are able to replicate this consistently, can you please update to 0.68.1 and disable thumbnail generation to verify if it fixes the issue? Please let us know on #18166!

image