Bug 500868

Summary: Desktop icons get rearranged after changing screen scale to new-never-before-used scale, in cases where the existing layout should be preserved
Product: [Plasma] plasmashell Reporter: alt
Component: Desktop icons & Folder View widgetAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: minor CC: akselmo, cdennett, hein, ilikefoss, nate, seehawong805
Priority: NOR    
Version First Reported In: 6.3.1   
Target Milestone: 1.0   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 503500    

Description alt 2025-02-28 18:25:06 UTC
SUMMARY
Desktop icons get rearranged after changing screen scale on plasma 6.3. Specifically, it seems that each scale has its own (random) arrangement. The arrangement is saved for every scale, but it is random at the beginning. I think the icons should preserve (or at least try to preserve as much as possible) the same order across all scaling factors, though, and not get a random arrangement or save a different arrangement for each scale.

If there are people who prefer a per-scale arrangement then I propose to add an option to choose between these two kinds of behavior.

PROPOSED SOLUTION
Let's say that the icons are arranged in a desktop grid whose cells are numbered starting from the top left corner and going either left to right or top to bottom depending on the set arrangement option. Then every icon is associated with a position number (the number of the cell), but note that this position is relative to the grid layout and not absolute because the grid will change with the scaling factor and the positions of the cells will be shifted.
If the icons were to be manually arranged by the user while using a certain scale, that same arrangement should be followed by every other scale, possibly respecting empty spaces between icons (respecting the position number of all icons across various grid layouts) even if the icons get shifted. If this is not possible (because some icons would be out of display, for instance) then at least the order should be respected by bringing together distant icons (eliminating the spaces between them).

This is just the first solution that came to my mind. If you don't find it neat you can always elaborate a new one or just simply choose to respect the icon's order as much as possible and not strictly their position.

STEPS TO REPRODUCE
1. change the scaling factor in display settings

OBSERVED RESULT
Icons get rearranged randomly if not already been manually arranged at that scale, otherwise their positions are restored for that specific scale arrangement.

EXPECTED RESULT
Icons should have at least the same order for every scale.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 6.3.1
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.12.15-1-MANJARO (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 John 2025-03-03 18:46:25 UTC
I can confirm this behavior on Debian 13 (Trixie) - unstable repository, up to Plasma 6.3.2!
I have switched the default arrangement of icons from left-to-right to top-to-bottom to be more like I got used to with Windows and to still have new icons visible when I have a window tiled on the right half of the screen.
So, even with this non-default arrangement the reorder happens when the scale is changed.
All the scaling levels were between 100-130.

I agree with OP's both proposals.
1. Take notice of the preferred arrange direction, if it's left to right or top to bottom, then give numbers to the cell grids and try to put the icons in the same numbers as before for the new scale.
The only problem I see here is the case when the scale is bigger than the previous one, which I assume the bigger text (or icons too) will make the cells bigger, meaning less of them will fit on the horizontal or vertical row of cells.
In that case, put the last ones that doesn't fit anymore on the row on the new horizontal or vertical row.
If some icons are not in the first or second horizontal or vertical row (closest to the top or left edge of the screen), like being in the middle of the screen, then leave them there if you can, if not add them after the last ones of the first or second horizontal or vertical row.
Make this the default behavior.

2. Make the  per-scale arrangement opt-in as my guess is that few people can actually fill their heads with a per-scale arrangement.
I think that's a hard one to remember and possibly also time wasting to make so that's why I think few people would prefer it.

I've been pretty happy with how well the icons stick to their positions starting with Plasma 6.3.0, except for this scaling thing that is capable of messing them again.
I also had to test for a bug report if a problem was happening on X session too and because I was using a 130 scale on Wayland for quite some time, not knowing that that X was not in sync with that after I entered the X session the icons were immediately messed up.
Which if I remember correctly they were still messed up when I got back to the Wayland session after the test I don in X.
So having 2 rows of icons messed up, just because I wanted to help confirm a bug report by switching the session type was not nice.
And as much as I want to help with all the bug triaging and confirming will make me reluctant to switch again into the X session to see how the things are there. I think I tried to manually make the scale there to be 130 too, but IIRC, it was not possible for some reason.
Comment 2 Nate Graham 2025-03-05 18:52:05 UTC
It's already supposed to try to preserve the existing arrangement as much as it can when you change to a new, never-before-used scale. There's a limit to what's possible here when making the desktop canvas smaller, but when making it bigger it's supposed to just add extra space around the existing layout.

I can see that this is seemingly not working quite right.
Comment 3 Akseli Lahtinen 2025-07-04 09:19:12 UTC
This seems to happen because we save the screen resolution and apply the scaling as well to it.

I think this might be fixed by using the 1:1 resolution no matter what when saving the icon ordering, even when display scaling is used.