-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PTRun]Asynchronously load image and thumbnails #24736
[PTRun]Asynchronously load image and thumbnails #24736
Conversation
Looks nice! |
else if (!generateThumbnailsFromFiles || (extension == ".pdf" && WindowsThumbnailProvider.DoesPdfUseAcrobatAsProvider())) | ||
{ | ||
// The PDF thumbnail provider from Adobe Reader and Acrobat Pro lets crash PT Run with an Dispatcher exception. (https://github.com/microsoft/PowerToys/issues/18166) | ||
// To not run into the crash, we only request the icon of PDF files if the PDF thumbnail handler is set to Adobe Reader/Acrobat Pro. | ||
// Also don't get thumbnail if the GenerateThumbnailsFromFiles option is off. | ||
type = ImageType.File; | ||
image = WindowsThumbnailProvider.GetThumbnail(path, Constant.ThumbnailSize, Constant.ThumbnailSize, ThumbnailOptions.IconOnly); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should remove it. On my test system Adobe's provider shows always black (and broken) images in explorer.
We should keep it and maybe hide it behind a setting to enable it if Adobe thumbnails makes trouble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be covered by "Generate thumbnails from files" disabled option as a fallback, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then you have no thumbnails for all types instead of only for Acrobat PDF files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Although, I'm not too fond of the idea of keep adding these exceptional cases. I guess we can keep covering this one as AdobeReader is quite popular and widely used software and hopefully won't end up adding a bunch of these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Great improvement that hopefully makes PT more stable.
Thanks for the help everyone! |
* [PTRun]Asynchronously load image and thumbnails * Bring back check for Adobe PDF generated thumbnails --------- Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
Summary of the Pull Request
Thumbnail image loading on PowerToys Run is now done asynchronously, similar to the improvement that FlowLauncher as adopted as well.
In my tests, this fixes the #18166 dispatcher error we've been seeing so frequently for a long time.
I'm distributing a non official build as well for affected users to be able to give it a test.
This PR also removes the special case we added for Adobe Reader and pdf files.
PR Checklist
Validation Steps Performed
This error is quite hard to replicate. Best way here is just checking if PT Run still works OK and let's try to have the users give us some feedback on the issue.