Bug 464873 - Icons on active activity reorder after screen connect/disconnect
Summary: Icons on active activity reorder after screen connect/disconnect
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Folder (show other bugs)
Version: 5.26.90
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-26 21:06 UTC by Gábor Katona
Modified: 2023-03-08 18:34 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.3


Attachments
Desktop icons arranged originally (17.11 KB, image/png)
2023-02-07 10:01 UTC, Gábor Katona
Details
Desktop icons after disconnecting external screen (17.40 KB, image/png)
2023-02-07 10:01 UTC, Gábor Katona
Details
Desktop icons after reconnecting external screen (16.59 KB, image/png)
2023-02-07 10:02 UTC, Gábor Katona
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gábor Katona 2023-01-26 21:06:02 UTC
SUMMARY
I am using activities and with 5.26.90 I have realized that while the old screen management issues are gone, a new issue appeared. I have different set of icons on the desktop for each activity. When I log out and log in again the icons on the activity I was at when logging out are reordered by name and moved to the upper left edge. The other activities are not affected. If I log out from another activity, then that will be affected, so it is not linked to a specific activity, always the active suffers. It also happens when I disconnect and connect a screen, however in this case after disconnection only some of the icons change position and after re-connection they are moved to the upper left edge and ordered by name.

STEPS TO REPRODUCE
1. Setup more than one activity
2. Arrange the icons on each activity so that they re not ordered by name.
3. Log out and log in

OBSERVED RESULT
The icons change their position and order.

EXPECTED RESULT
The icons should stay in place.

SOFTWARE/OS VERSIONS
Linux: openSUSE Tumbleweed 20230123
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Using a Lenovo laptop with 1920x1200 resolution with an external screen with 1920x1080. Only one screen is active at a time. The issue also happens when manually switching the screens without physical disconnection.
Comment 1 Gábor Katona 2023-01-26 21:11:33 UTC
I have just made further tests. It seems that log out and log in is not affected in reality. The case is that when I logged out, there was screen change (the built-in screen is activated). When logging out without external screen attached the issue does not happen. 
So it is connected to screen management, maybe the component should be changed
Comment 2 Nate Graham 2023-01-27 19:44:40 UTC
Well, that's progress at least. :)

Are these desktop icons that keep getting re-ordered files and folders, or are they launcher widgets for apps?
Comment 3 Gábor Katona 2023-01-27 20:11:50 UTC
Definitely great progress so far, although I still have problems with detecting the screens attached to docking station, but I think this is hardware detection problem.

I guess (maybe) launcher widgets for apps, for me these are just icons to start a program: I have set the desktop to show a folder, which contains .desktop files to start applications.

This is from plasma-org.kde.plasma.desktop-appletsrc

positions={"1920x1080":["1"\\,"20"\\,"file:///home/katonag/.Desktop/Firefox"\\,"0"\\,"0"\\,"file:///home/katonag/.Desktop/Krusader"\\,"0"\\,"1"\\,"file:///home/katonag/.Desktop/Thunderbird"\\,"0"\\,"2"\\,"file:///home/katonag/.Desktop/Windows10"\\,"0"\\,"3"]\\,"1920x1200":["4"\\,"20"\\,"file:///home/katonag/.Desktop/Windows10"\\,"3"\\,"5"\\,"file:///home/katonag/.Desktop/Firefox"\\,"3"\\,"8"\\,"file:///home/katonag/.Desktop/Thunderbird"\\,"3"\\,"6"\\,"file:///home/katonag/.Desktop/Krusader"\\,"3"\\,"7"]\\,"0x0":["1"\\,"20"\\,"file:///home/katonag/.Desktop/Firefox"\\,"0"\\,"0"\\,"file:///home/katonag/.Desktop/Krusader"\\,"0"\\,"1"\\,"file:///home/katonag/.Desktop/Thunderbird"\\,"0"\\,"2"\\,"file:///home/katonag/.Desktop/Windows10"\\,"0"\\,"3"]}

Originally Firefox was the last entry in a row at the top left edge.
Comment 4 Gábor Katona 2023-01-27 20:53:30 UTC
More info: issuing 

kquitapp5 plasmashell && kstart plasmashell

restores the set order
Comment 5 Nate Graham 2023-02-02 20:11:19 UTC
Does this still happen if you only have a single activity? Or is it limited to the multi-activity use case?
Comment 6 Gábor Katona 2023-02-07 10:01:04 UTC
Sorry for the late reply. I have tested it by creating a fresh user. I have logged in, the desktop had Trash and Home as default. I have added Firefox and System setting simply by copying from the panel.

Ordered them (see fig 1.png) in reverse alphabetical order and Trash moved away. After disconnecting the external screen the icons were reordered in some random way (2.png). Reconnecting the external screen resulted again in reordering (3.png), now in alphabetical order, except Trash, which is moved to the top left corner, where it was originally.
Comment 7 Gábor Katona 2023-02-07 10:01:33 UTC
Created attachment 156021 [details]
Desktop icons arranged originally
Comment 8 Gábor Katona 2023-02-07 10:01:51 UTC
Created attachment 156022 [details]
Desktop icons after disconnecting external screen
Comment 9 Gábor Katona 2023-02-07 10:02:09 UTC
Created attachment 156023 [details]
Desktop icons after reconnecting external screen
Comment 10 Nate Graham 2023-02-11 01:25:19 UTC
Thanks for the info.
Comment 11 Bug Janitor Service 2023-03-01 15:30:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1409
Comment 12 Marco Martin 2023-03-03 11:16:08 UTC
Git commit ea3ab420547dfbbe861275ca37dbf8e032a787fe by Marco Martin.
Committed on 03/03/2023 at 11:15.
Pushed by mart into branch 'Plasma/5.27'.

Partly revert "make sure screen numbers are consecutive"

This partly reverts commit 074e4efecba92e32b7fefffe68f9734be0a61e8b.
That patch for screen consistency was quite error prone: when a screen gets removed, only the mappings of the current activity will be removed, therefore the assumption that the screens on itemsOnDisabledScreens have all an id major than the ones in screenMapping does not hold. at every plasma startup therefore itemsOnDisabledScreens would get ids reassigned to numbers that won't make sense

M  +3    -22   containments/desktop/plugins/folder/screenmapper.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/ea3ab420547dfbbe861275ca37dbf8e032a787fe
Comment 13 Marco Martin 2023-03-03 11:37:24 UTC
Git commit a9fece2eaa7e848253548b96a0f4481b1965021f by Marco Martin.
Committed on 03/03/2023 at 11:37.
Pushed by mart into branch 'master'.

Partly revert "make sure screen numbers are consecutive"

This partly reverts commit 074e4efecba92e32b7fefffe68f9734be0a61e8b.
That patch for screen consistency was quite error prone: when a screen gets removed, only the mappings of the current activity will be removed, therefore the assumption that the screens on itemsOnDisabledScreens have all an id major than the ones in screenMapping does not hold. at every plasma startup therefore itemsOnDisabledScreens would get ids reassigned to numbers that won't make sense

M  +3    -22   containments/desktop/plugins/folder/screenmapper.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/a9fece2eaa7e848253548b96a0f4481b1965021f
Comment 14 Gábor Katona 2023-03-03 11:43:39 UTC
It is partly offtopic, but could you advise me where to report screen detection issues? The screens connected to usb-c dock are not detected reliably. Maybe it is also connected to KDE screen management, because I feel like it became worse since 5.27, but not sure. I feel more like a hardware detection issue (sometimes even the screen EDIDs are mixed up)
Comment 16 Nate Graham 2023-03-08 18:34:05 UTC
*** Bug 466869 has been marked as a duplicate of this bug. ***