Emptying the Recycle Bin stops when the preview window is closed

Open
#2,068 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

  • #2069 by @mohamadsm313m-prog — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
desktop

Research direction

Start at the Recycle Bin preview button that calls SHEmptyRecycleBin in the QuickLook viewer process, and trace how that operation is launched. The issue proposes a detached QuickLook.exe --empty-recycle-bin helper; check how command-line arguments are handled. Done means emptying continues after the preview closes or another file is previewed, without blocking the viewer.

Written by the indexing model from the issue text.

Description

Description

When the Recycle Bin is previewed, the "Empty Recycle Bin" button runs SHEmptyRecycleBin inside the QuickLook viewer process. Because the preview is unloaded whenever the window closes or another file is previewed, the deletion is aborted in those cases. The operation also runs on the UI thread, so the viewer stops responding until the deletion finishes.

Steps to reproduce
  1. Open the Recycle Bin in Explorer (with some files in it).
  2. Press Space to preview it with QuickLook and press the "Empty Recycle Bin" button, then confirm.
  3. Immediately close the preview window, or press Space on another file in Explorer.
  4. The Recycle Bin is not emptied (or only partially emptied).
Expected behavior

The deletion should keep running in the background, independent of the preview window, until the Recycle Bin is empty.

Environment
  • QuickLook 4.5.0
  • Windows 11 (10.0.26100)
Proposed fix

Run the emptying in a detached QuickLook.exe --empty-recycle-bin helper process (see the linked pull request).

Dominant language
C#
Stars
25.7k
Forks
1.4k
Avg merge
3d 19h
Merged PRs (30d)
3

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from QL-Win/QuickLook

All issues in QL-Win/QuickLook

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.