Plasma 6 proposal: re-think how desktop icons positions are stored for multi-screen arrangements to be more deterministic and robust
We did a big multiscreen overhaul in Plasma 5.27 that overall has been received very well.
But unfortunately it has exposed cracks in how icon positions are stored and mapped to screens/containments/etc. For years we have struggled with issues relating to icons getting lost or resetting their positions, and I'd like to propose a design document of specific use cases to envision how we can design a more robust solution:
User has 1 screen
Icons don't move unless the user re-arranges them
~/Desktop
or moves existing ones there
User creates new files or folders in They're placed on the current primary screen and arranged per the default arrangement rules.
User increases the physical or logical resolution (e.g. by decreasing the scale factor) of a screen
Icons on that screen don't move, but rather empty space is added to the right and the bottom (at least when using the default icon arrangement settings; when using different ones, empty space may need to be added elsewhere).
Icon positions for the new resolution are saved such that the next time the user uses the same screen arrangement (including screen resolution), the icons return to their positions.
User decreases the physical or logical resolution (e.g. by increasing the scale factor) of a screen
Empty space to right bottom and to the right of the icons is removed, preserving icon positions as much as possible. If enough space needs to be removed that any icons live in a position that's now gone, they move
Icon positions for the new resolution are saved such that the next time the user uses the same screen arrangement (including screen resolution), the icons return to their positions.
User connects a new screen with a resolution that has never been seen before
Icons don't move at all.
User re-arranges some icons on one screen, then disconnects another screen that has no icons on it
Icons on that screen don't move at all.
User disconnects a screen that has icons on it
Icons on the now-disconnected screen move to the nearest active screen, preferring the positions that they had on the active screen, if there's a saved configuration including those icons with custom positions. If not, they're arranged per the default arrangement rules.
User re-connects the screen that had icons on it and was then disconnected
The icons that were on that screen before move back to it, in the positions they had when it was connected
~/Desktop
User has always used a complicated three-screen arrangement with the center screen being primary and icons on each screen, and never had any other screen arrangements. The center screen disconnects, then the user adds a bunch of new files or folders to Icons that were on the now-disconnected primary screen move to the new primary screen, per the default arrangement order. Icons newly added to ~/Desktop
are arranged on the new primary screen per the default arrangement rules.
Now that same user re-connects the original middle primary screen
The icons that were formerly on the middle primary screen return to their positions on it. The icons that were added while the middle screen was disconnected don't move from their current locations on the former primary screen.