Fix trash icon never updating and Empty Trash not emptying (+ GNOME 50 ignoreRelease guard) - #353
Open
svan71 wants to merge 2 commits into
Open
Fix trash icon never updating and Empty Trash not emptying (+ GNOME 50 ignoreRelease guard)#353svan71 wants to merge 2 commits into
svan71 wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related fixes for the trash docklet, plus a GNOME 50 compatibility guard.
1. Trash full/empty icon never updated —
updateIcon()flips the icon betweenuser-trashanduser-trash-full, but it ran after the renderer had already readicon_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 intoupdateIconState(), 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) —
setupTrashIconpointstrash_actionatempty-trash.sh, but a leftover block immediately overwrote it with a hardcodedrm -rfof~/.local/share/Trash. That meant trash on mounted volumes was never emptied, and since rawrmbypasses GVFS, thetrash://monitor never saw the change — so even the home trash icon didn't refresh. Removed the override, switched the script togio trash --empty(proper GVFS events), pre-enumeratetrash://first so lazily-discovered.Trash-$UIDdirs on mounted volumes get emptied too, and droppedTerminal=truefrom 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.