Bug 482875 - When encountering a "zero screens connected" condition, desktop icons get re-arranged (first time in alphabetical order, then after that randomly)
Summary: When encountering a "zero screens connected" condition, desktop icons get re-...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Folder (show other bugs)
Version: 6.1.3
Platform: Arch Linux Linux
: HI normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6, wayland
: 484613 493569 494353 494551 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-08 13:39 UTC by linuxboy
Modified: 2024-11-18 09:45 UTC (History)
10 users (show)

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


Attachments
PRE.PNG (Icons before) (763.33 KB, image/png)
2024-03-08 13:39 UTC, linuxboy
Details
POST.PNG (352.69 KB, image/png)
2024-03-08 13:41 UTC, linuxboy
Details
ENERGYSAVING.PNG (73.25 KB, image/png)
2024-03-08 13:41 UTC, linuxboy
Details
Windows size after few hours of standby (307.44 KB, image/png)
2024-03-31 20:38 UTC, Velent
Details
Dolphin places panel size after few hours of standby (6.19 KB, image/png)
2024-03-31 20:40 UTC, Velent
Details
My Desktop at start (562.90 KB, image/png)
2024-10-23 12:13 UTC, linuxboy
Details
SCRSHOT2.png (146.17 KB, image/png)
2024-10-23 12:14 UTC, linuxboy
Details
SCRSHOT1.png (562.90 KB, image/png)
2024-10-23 12:14 UTC, linuxboy
Details
SCRSHOT3.png (561.28 KB, image/png)
2024-10-23 12:15 UTC, linuxboy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description linuxboy 2024-03-08 13:39:33 UTC
Created attachment 166714 [details]
PRE.PNG (Icons before)

Desktop icons reset positions to alphabetical order after a long time from auto shut-off of screen

STEPS TO REPRODUCE
1. Place your icons in your preferred position (f.e. see PRE.PNG attachment)
2. Configure your energy-saving like in ENERGYSAVING.PNG mode
3. Configure your icons order Desktop->Icons->Order->Not Ordered
4. Leave the PC for 30-40 minutes

EXPECTED RESULT
1. The screen goes off after 10 minutes
2. after 20-30 minutes further, move the mouse, unlock the PC and you should find the icons as you previously arranged them.

OBSERVED RESULT
1. The screen goes off after 10 minutes
2. after 20-30 minutes further, move the mouse, unlock the PC and you will discover that the position of the icons has changed and they are now arranged alphabetically starting from the left (see POST.PNG attachment)

SOFTWARE/OS VERSIONS
Linux: 6.7.8
KDE Plasma Version: 6.01
KDE Frameworks Version: 6.01 
Qt Version: 6.6.2

ADDITIONAL INFORMATION
None
Comment 1 linuxboy 2024-03-08 13:41:21 UTC
Created attachment 166715 [details]
POST.PNG
Comment 2 linuxboy 2024-03-08 13:41:57 UTC
Created attachment 166716 [details]
ENERGYSAVING.PNG
Comment 3 linuxboy 2024-03-08 13:46:37 UTC
NOTE: This bug has persisted since KDE 5, but for about 2 months it seemed to have disappeared. It reappeared yesterday, with the upgrade to kde 6.01.
Comment 4 linuxboy 2024-03-14 13:45:37 UTC
Note: the bug persists in version 6.02, under Wayland graphics server.
Comment 5 linuxboy 2024-03-16 18:04:26 UTC
Note: my screen is 3840x2160. In plasma Preferences->ScreenConfiguration->Scale I have 125% set.
Comment 6 Christophe Marin 2024-03-28 08:00:14 UTC
*** Bug 484613 has been marked as a duplicate of this bug. ***
Comment 7 linuxboy 2024-03-30 21:35:18 UTC
Hello,
Note: the bug persists in version 6.03.
Comment 8 Velent 2024-03-31 20:38:48 UTC
Created attachment 168000 [details]
Windows size after few hours of standby

I've noticed that standby affects not only icons, but sometimes the size of windows and UI panels in qt applications
Comment 9 Velent 2024-03-31 20:40:01 UTC
Created attachment 168001 [details]
Dolphin places panel size after few hours of standby
Comment 10 linuxboy 2024-04-18 08:18:05 UTC Comment hidden (spam)
Comment 11 linuxboy 2024-05-29 18:59:55 UTC Comment hidden (spam)
Comment 12 linuxboy 2024-06-21 12:17:31 UTC Comment hidden (spam)
Comment 13 linuxboy 2024-06-27 18:41:58 UTC Comment hidden (spam)
Comment 14 linuxboy 2024-07-05 15:29:27 UTC Comment hidden (spam)
Comment 15 linuxboy 2024-07-21 11:22:47 UTC Comment hidden (spam)
Comment 16 TraceyC 2024-07-31 23:35:02 UTC
There are multiple bug reports about this behavior. I'm using 468546 as the main bug report.

*** This bug has been marked as a duplicate of bug 468546 ***
Comment 17 linuxboy 2024-10-16 14:09:20 UTC
The bug disappeared in plasma 6.2, but the randomly alphabetical repositioning of icons reappeared in 6.2.1.
This time it happens to me randomly: for example when I use the browser for an hour, when I then close it I find the icons realigned in alphabetical order starting from left to right.
Comment 18 Nate Graham 2024-10-22 19:47:12 UTC
Can I ask you to try to make it happen in a new clean user account *with no settings customization*? If it doesn't happen there, then it's an issue caused by some combination of settings in your main user account, and we'll need to figure out which ones.

Thanks!
Comment 19 linuxboy 2024-10-23 12:13:00 UTC
Created attachment 175136 [details]
My Desktop at start
Comment 20 linuxboy 2024-10-23 12:14:25 UTC
Created attachment 175137 [details]
SCRSHOT2.png
Comment 21 linuxboy 2024-10-23 12:14:54 UTC
Created attachment 175138 [details]
SCRSHOT1.png
Comment 22 linuxboy 2024-10-23 12:15:37 UTC
Created attachment 175139 [details]
SCRSHOT3.png
Comment 23 linuxboy 2024-10-23 12:17:14 UTC
(In reply to Nate Graham from comment #18)
> Can I ask you to try to make it happen in a new clean user account *with no
> settings customization*? If it doesn't happen there, then it's an issue
> caused by some combination of settings in your main user account, and we'll
> need to figure out which ones.

Hi Nate.
So, I did the following:

1) I created a new user with the command:
$> sudo useradd -G users,wheel,video,audio,disk -m felice2

2) I exited my plasma session and re-login plasma as this new user
3) right click on the screen and checked that the icon order was "not sorted".
5) I created some directories and files and placed the group towards the center of the desktop
5) I pinned some existing directories on the desktop and randomly arranged them on the screen.
6) the result is in the screen SCRSHOT1.png
7) in the settings, power management, the default situation was the one in the screen SCRSHOT2.png. I left it unchanged.
8) I exited the session and restarted the PC.
9) After the restart, the desktop still appeared as in SCRSHOT1.png. So I left the PC alone for 30 minutes. The PC went into sleep mode after 15 minutes.
10) I woke up the PC and the desktop appeared as in the SCRSHOT3.png screen

As you can see, even for a new user there are no differences: the icons are rearranged alphabetically from left to right, for no apparent reason.
Comment 24 Nate Graham 2024-10-23 17:50:19 UTC
Found the way to reproduce it: you have to end up with zero screens. Most screens these days don't actually completely disappear when turned off; they need to be physically unplugged for that to happen. However some do disappear when turned off.

In either case, if the system is running when it encounters a "zero screens connected" situation, this issue happens.
Comment 25 Nate Graham 2024-10-23 17:50:32 UTC
*** Bug 494551 has been marked as a duplicate of this bug. ***
Comment 26 Nate Graham 2024-10-23 18:11:51 UTC
Ahh, only the first time I did it did the icons get re-arranged alphabetically.

AFter that, I re-arranged them again, and now when I trigger a "zero screens connected" situation, they don't get re-arranged alphabetically but rather seemingly randomly. Looks like these are all the same bug, yeah.
Comment 27 Nate Graham 2024-10-23 18:12:22 UTC
*** Bug 494353 has been marked as a duplicate of this bug. ***
Comment 28 Nate Graham 2024-10-23 18:12:25 UTC
*** Bug 493569 has been marked as a duplicate of this bug. ***
Comment 29 Bug Janitor Service 2024-10-29 14:16:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2607
Comment 30 Akseli Lahtinen 2024-11-06 16:30:31 UTC
Git commit cc44615b34dacc2a4acfdc82de885c943318a7f6 by Akseli Lahtinen.
Committed on 06/11/2024 at 16:30.
Pushed by akselmo into branch 'master'.

Refactor icon positioner saving and loading

The icon positioner saving and loading is handled by QML, which makes it a bit difficult
to work with the logic in positioner CPP files.

This change does the following:
- Explicitly save only on user interactions
- Moved the save and load of config to positioner.cpp
  - Easier debugging of the saving and loading functions
  - Still uses the JSON style of save/loading like the old one
    - Technically should be compatible with the old config, which was also JSON.
- Makes positionerApplet accessible from FolderView qml
- Various checks for checking if screen is enabled or not to avoid doing unnecessary work when screen is off
- A lot of fixes to avoid any racing conditions
- Removed any timers
- Added various unit tests

Alternative to https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2603
Related: bug 494874, bug 472137, bug 433867, bug 494412, bug 468619, bug 449069, bug 495047, bug 453314
FIXED-IN: 6.3.0

M  +1    -1    containments/desktop/package/contents/ui/FolderView.qml
M  +1    -48   containments/desktop/package/contents/ui/FolderViewLayer.qml
M  +165  -26   containments/desktop/plugins/folder/autotests/positionertest.cpp
M  +18   -3    containments/desktop/plugins/folder/autotests/positionertest.h
M  +23   -7    containments/desktop/plugins/folder/foldermodel.cpp
M  +5    -0    containments/desktop/plugins/folder/foldermodel.h
M  +176  -60   containments/desktop/plugins/folder/positioner.cpp
M  +37   -8    containments/desktop/plugins/folder/positioner.h

https://invent.kde.org/plasma/plasma-desktop/-/commit/cc44615b34dacc2a4acfdc82de885c943318a7f6
Comment 31 linuxboy 2024-11-06 19:07:41 UTC
(In reply to Akseli Lahtinen from comment #30)
> Git commit cc44615b34dacc2a4acfdc82de885c943318a7f6 by Akseli Lahtinen.
> Committed on 06/11/2024 at 16:30.
> Pushed by akselmo into branch 'master'.

Thanks, I can't wait to try it.
Comment 32 John A. Ward 2024-11-07 19:48:34 UTC
Thank you for your work, and responding. I guess my action should be, load new updates.
Comment 33 Nate Graham 2024-11-07 20:01:36 UTC
...Once Plasma 6.3 is released, yeah! That's the version that will contain the fix.
Comment 34 painless roaster 2024-11-18 09:45:10 UTC
This bug is very annoying and thank you very much for addressing it.
I tried to apply the patch on fedora in the plasma-desktop-6.2.3 package. But plasmashell crashes with it right after starting.

(In reply to Akseli Lahtinen from comment #30)
> Git commit cc44615b34dacc2a4acfdc82de885c943318a7f6 by Akseli Lahtinen.
> Committed on 06/11/2024 at 16:30.
> Pushed by akselmo into branch 'master'.
> 
> Refactor icon positioner saving and loading
> 
> The icon positioner saving and loading is handled by QML, which makes it a
> bit difficult
> to work with the logic in positioner CPP files.
> 
> This change does the following:
> - Explicitly save only on user interactions
> - Moved the save and load of config to positioner.cpp
>   - Easier debugging of the saving and loading functions
>   - Still uses the JSON style of save/loading like the old one
>     - Technically should be compatible with the old config, which was also
> JSON.
> - Makes positionerApplet accessible from FolderView qml
> - Various checks for checking if screen is enabled or not to avoid doing
> unnecessary work when screen is off
> - A lot of fixes to avoid any racing conditions
> - Removed any timers
> - Added various unit tests
> 
> Alternative to
> https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2603
> Related: bug 494874, bug 472137, bug 433867, bug 494412, bug 468619, bug
> 449069, bug 495047, bug 453314
> FIXED-IN: 6.3.0
> 
> M  +1    -1    containments/desktop/package/contents/ui/FolderView.qml
> M  +1    -48   containments/desktop/package/contents/ui/FolderViewLayer.qml
> M  +165  -26  
> containments/desktop/plugins/folder/autotests/positionertest.cpp
> M  +18   -3    containments/desktop/plugins/folder/autotests/positionertest.h
> M  +23   -7    containments/desktop/plugins/folder/foldermodel.cpp
> M  +5    -0    containments/desktop/plugins/folder/foldermodel.h
> M  +176  -60   containments/desktop/plugins/folder/positioner.cpp
> M  +37   -8    containments/desktop/plugins/folder/positioner.h
> 
> https://invent.kde.org/plasma/plasma-desktop/-/commit/
> cc44615b34dacc2a4acfdc82de885c943318a7f6