Bug 495990 - When restoring trashed files/folders back to the Desktop, they appear in the top-left corner rather than their former position before being trashed
Summary: When restoring trashed files/folders back to the Desktop, they appear in the ...
Status: RESOLVED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop icons & Folder View widget (other bugs)
Version First Reported In: 6.2.3
Platform: Arch Linux Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-08 23:37 UTC by Fernando M. Muniz
Modified: 2024-11-21 20:29 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Sometimes they're slightly wrong. Sometimes they just go the grid's first available corner. (506.54 KB, video/mp4)
2024-11-08 23:42 UTC, Fernando M. Muniz
Details
Deleted files seem to have stored locations (2.70 MB, video/x-matroska)
2024-11-13 19:30 UTC, Fernando M. Muniz
Details
All of the positions of deleted desktop files/folders are memorized. (3.54 MB, video/x-matroska)
2024-11-21 00:43 UTC, Fernando M. Muniz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando M. Muniz 2024-11-08 23:37:58 UTC
Restored trashed desktop files/folders are not returning to their correct (and available) placement on desktop.
Comment 1 Fernando M. Muniz 2024-11-08 23:42:00 UTC
Created attachment 175666 [details]
Sometimes they're slightly wrong. Sometimes they just go the grid's first available corner.
Comment 2 Fernando M. Muniz 2024-11-09 09:24:00 UTC
This might have been fixed by https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2603
I'm not sure.
Comment 3 Fernando M. Muniz 2024-11-09 09:36:19 UTC
Sorry, this one is that might be the fix for this: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2607
Comment 4 Nate Graham 2024-11-13 19:03:51 UTC
Nope, not fixed by that; I can still reproduce it.

Conceptually I'm not sure it's cleanly possible to fix, though. Currently, when an item is removed from the desktop, we remove stored position information for it. If we didn't do this, the position information would grow infinitely, eventually consuming all space on the machine.

The only way we could feasibly do this is if we recognize when an item was removed from the desktop *because it was moved to the trash* and preserve the position information for it while it's in the trash, only deleting the information once the trash is emptied. That might work. We would also need to handle edge cases like when another item has since been moved into the location that the trashed item previously occupied.

What do you think, Akseli? Feasible or no?
Comment 5 Fernando M. Muniz 2024-11-13 19:30:47 UTC Comment hidden (spam)
Comment 6 Nate Graham 2024-11-13 19:43:02 UTC Comment hidden (spam)
Comment 7 Akseli Lahtinen 2024-11-13 23:16:46 UTC
(In reply to Nate Graham from comment #4)
> Nope, not fixed by that; I can still reproduce it.
> 
> Conceptually I'm not sure it's cleanly possible to fix, though. Currently,
> when an item is removed from the desktop, we remove stored position
> information for it. If we didn't do this, the position information would
> grow infinitely, eventually consuming all space on the machine.
> 
> The only way we could feasibly do this is if we recognize when an item was
> removed from the desktop *because it was moved to the trash* and preserve
> the position information for it while it's in the trash, only deleting the
> information once the trash is emptied. That might work. We would also need
> to handle edge cases like when another item has since been moved into the
> location that the trashed item previously occupied.
> 
> What do you think, Akseli? Feasible or no?

There's a way to do it I think, but I am not sure if it will cause other problems.
Comment 8 Fernando M. Muniz 2024-11-21 00:43:14 UTC
Created attachment 175993 [details]
All of the positions of deleted desktop files/folders are memorized.

The new files are going to the expanded space of the desktop exactly where I had a file for the last time before I deleted it.
Comment 9 Nate Graham 2024-11-21 20:17:58 UTC
Deleted and trashed files/folders go through different codepaths. It looks like positions are correctly forgotten for trashed files, but not for deleted files. As such, *this* bug report is intentional per the comments earlier. Can you open a new one for the issue whereby deleted files/folders don't get their position data forgotten as intended? Thanks!
Comment 10 Fernando M. Muniz 2024-11-21 20:29:21 UTC
(In reply to Nate Graham from comment #9)
> Deleted and trashed files/folders go through different codepaths. It looks
> like positions are correctly forgotten for trashed files, but not for
> deleted files. As such, *this* bug report is intentional per the comments
> earlier. Can you open a new one for the issue whereby deleted files/folders
> don't get their position data forgotten as intended? Thanks!

Done. Bug 496556