Skip to content

Fix trash icon never updating and Empty Trash not emptying (+ GNOME 50 ignoreRelease guard) - #353

Open
svan71 wants to merge 2 commits into
icedman:mainfrom
svan71:fix-trash-empty
Open

Fix trash icon never updating and Empty Trash not emptying (+ GNOME 50 ignoreRelease guard)#353
svan71 wants to merge 2 commits into
icedman:mainfrom
svan71:fix-trash-empty

Conversation

@svan71

@svan71 svan71 commented Jul 24, 2026

Copy link
Copy Markdown

Two related fixes for the trash docklet, plus a GNOME 50 compatibility guard.

1. Trash full/empty icon never updatedupdateIcon() flips the icon between user-trash and user-trash-full, but it ran after the renderer had already read icon_name, so the flip always lagged one animation tick. Because the debounced render loop usually settles before a second tick, the icon stayed visually stale indefinitely. The state flip is now split into updateIconState(), called at the top of the render loop before paint; positioning work (clock/calendar overlays) stays post-paint.

2. Empty Trash didn't actually empty (and fired no events)setupTrashIcon points trash_action at empty-trash.sh, but a leftover block immediately overwrote it with a hardcoded rm -rf of ~/.local/share/Trash. That meant trash on mounted volumes was never emptied, and since raw rm bypasses GVFS, the trash:// monitor never saw the change — so even the home trash icon didn't refresh. Removed the override, switched the script to gio trash --empty (proper GVFS events), pre-enumerate trash:// first so lazily-discovered .Trash-$UID dirs on mounted volumes get emptied too, and dropped Terminal=true from the generated desktop action.

3. PopupMenuManager.ignoreRelease() was removed in GNOME 50 and threw on every dock context-menu popup — now guarded with optional chaining.

Tested on GNOME 50 (Arch): icon flips immediately on trashing/restoring files, Empty Trash empties home and mounted-volume trash, context menus open without exceptions.

svan71 added 2 commits July 24, 2026 12:58
…er paints

updateIcon() ran after the renderer already read icon_name, so the
full/empty flip always lagged one animation tick — and the debounced
loop usually ended before a second tick, leaving the icon stale.
Split the state flip into updateIconState(), called at the top of the
renderer loop; positioning (clock/calendar overlays) stays post-paint.

Also: guard ignoreRelease() (removed from PopupMenuManager in GNOME 50,
threw on every dock context menu), and empty-trash.sh now uses
'gio trash --empty' so the trash:// monitor gets proper events.
…rash enumeration

setupTrashIcon pointed trash_action at empty-trash.sh but an upstream
leftover block immediately overwrote it with rm -rf on the home Trash dir,
so volume trash (NAS mounts) was never emptied and no gvfs events fired.
Also drop Terminal=true from the action and pre-enumerate trash:// in
empty-trash.sh so lazily-discovered .Trash-$UID dirs get emptied too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant