Bug 426880 - Pinned items with slashes in their URI (e.g. "preferred://" or apps from Flatpak or Steam) make IOTM icons jump around when other icons are re-arranged
Summary: Pinned items with slashes in their URI (e.g. "preferred://" or apps from Fla...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.19.90
Platform: Other Linux
: VHI normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords: regression
: 427033 432374 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-22 17:10 UTC by Nate Graham
Modified: 2021-02-01 19:20 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.7 and 5.20
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2020-09-22 17:10:16 UTC
Everything KDE from git master on top of openSUSE Tumbleweed.


STEPS TO REPRODUCE
1. Have the default Icons-Only Task Manager with its default set of four pinned apps: System Settings, Discover, preferred://filemanager and preferred://browser
2. Pin two other apps
3. Move one of the newly-pinned app icons to the left of the existing pinned icons
4. Move the second of the newly-pinned app icons anywhere


OBSERVED RESULT
The icons re-arrange themselves oddly


EXPECTED RESULT
Everything stays in place except for the icon you're moving


You can fix this issue entirely by un-pinning the file manager and web browser apps. The preferred:// entries seem to be causing some trouble here.
Comment 1 Nate Graham 2020-09-22 17:10:27 UTC
Seems like a very significant issue since this is the new set of default settings that we ship with. Raising priority accordingly.
Comment 2 Reiddragon 2020-09-22 17:31:19 UTC
looks like both preferred:// and flatpak icons can consistently cause this bug
Tested this on 2 machines running Arch Linux w/ Plasma 5.19.90 and the bug magically disappears on both machines once I remove all preferred:// and flatpak icons
Comment 3 Nate Graham 2020-09-22 17:33:04 UTC
Yes I can reproduce that too. If I remove all my preferred:// pinned items, but then I pin the Flatpak version of Discord, everything starts jumping around again when I try to move a different icon. If I unpin the Flatpak Discord and pin Discord from my distro's repo, the bug stops happening again.
Comment 4 Nate Graham 2020-09-22 17:36:17 UTC
When a flatpak app is pinned, the string added to the launchers= key in ~/.config/plasma-org.kde.plasma.desktop-appletsrc is something like this:

file:///var/lib/flatpak/exports/share/applications/com.discordapp.Discord.desktop

As opposed to the distro version, which results in the following string being added to the launchers= key:

applications:discord.desktop

I wonder if the presence of slashes in the string is the unifying factor here.
Comment 5 Reiddragon 2020-09-22 17:45:14 UTC
(In reply to Nate Graham from comment #4)
> When a flatpak app is pinned, the string added to the launchers= key in
> ~/.config/plasma-org.kde.plasma.desktop-appletsrc is something like this:
> 
> file:///var/lib/flatpak/exports/share/applications/com.discordapp.Discord.
> desktop
> 
> As opposed to the distro version, which results in the following string
> being added to the launchers= key:
> 
> applications:discord.desktop
> 
> I wonder if the presence of slashes in the string is the unifying factor
> here.

can confirm it's slashes
the Steam launcher created by the Arch package points to a full path just like flatpaks, and just like flatpaks it also causes the bug

btw, here are my launchers

launchers=applications:org.kde.dolphin.desktop,applications:vivaldi-stable.desktop,applications:firefox.desktop,applications:org.kde.discover.desktop,applications:cantata.desktop,applications:vlc.desktop,applications:org.kde.konsole.desktop,applications:Terraria.desktop,applications:net.lutris.Lutris.desktop,file:///usr/share/applications/steam.desktop,file:///var/lib/flatpak/exports/share/applications/org.telegram.desktop.desktop
Comment 6 Nikhil Prabhu 2020-09-22 18:34:10 UTC
Can confirm this happens to me with the Steam and Signal Flatpaks (If I remember correctly, I think the issue did not occur for me with the Spotify Flatpak. So it could be to do with the slashes as mentioned).
Comment 7 David Redondo 2020-09-24 17:21:27 UTC
I found you don't need to add pinned things. Just moving the four pinned entries around I can trigger it.

tasksmodel::move documentation says you should call syncLaunchers but we don't do that. However calling syncLaunchers doesn't fix this bug.
Comment 8 David Redondo 2020-09-28 08:48:07 UTC
*** Bug 427036 has been marked as a duplicate of this bug. ***
Comment 9 David Redondo 2020-09-28 08:49:06 UTC
*** Bug 427033 has been marked as a duplicate of this bug. ***
Comment 10 Eike Hein 2020-09-28 16:32:00 UTC
I'll have a look this week.
Comment 11 Nate Graham 2020-09-28 16:47:43 UTC
Thanks Eike!
Comment 12 Eike Hein 2020-10-04 18:14:15 UTC
Sorry, it took until Sunday to find a time window.

I've figured out the bug, patch should be up for review fairly soon.
Comment 14 Eike Hein 2020-10-04 22:27:35 UTC
Git commit fa00ca6a012faab30a9596a50a1b82f02e3e5c4e by Eike Hein.
Committed on 04/10/2020 at 19:35.
Pushed by hein into branch 'master'.

[libtaskmanager] Fix incorrect URL comparison when writing back a new launcher order

When computing the delta between the visible and the last saved launcher
order state, following the reordering of launchers, the code was incorrectly
comparing resolved and unresolved (i.e., for config storage) launcher URLs.
This lead to an incorrect result and therefore pinned tasks jumping around
in the Task Manager applet.

M  +11   -1    libtaskmanager/tasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/fa00ca6a012faab30a9596a50a1b82f02e3e5c4e
Comment 15 Nate Graham 2020-10-05 01:48:13 UTC
Git commit 21dce8daec2b2600312adfb78872c9ee7700266f by Nate Graham, on behalf of Eike Hein.
Committed on 05/10/2020 at 01:47.
Pushed by ngraham into branch 'Plasma/5.20'.

[libtaskmanager] Fix incorrect URL comparison when writing back a new launcher order

When computing the delta between the visible and the last saved launcher
order state, following the reordering of launchers, the code was incorrectly
comparing resolved and unresolved (i.e., for config storage) launcher URLs.
This lead to an incorrect result and therefore pinned tasks jumping around
in the Task Manager applet.
(cherry picked from commit fa00ca6a012faab30a9596a50a1b82f02e3e5c4e)

M  +11   -1    libtaskmanager/tasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/21dce8daec2b2600312adfb78872c9ee7700266f
Comment 16 Nate Graham 2021-02-01 19:19:30 UTC
*** Bug 432374 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2021-02-01 19:20:20 UTC
Git commit 2ea791b2fb6c125ea25258cbbcf4ae60daef460a by Nate Graham, on behalf of Eike Hein.
Committed on 01/02/2021 at 19:20.
Pushed by ngraham into branch 'Plasma/5.18'.

[libtaskmanager] Fix incorrect URL comparison when writing back a new launcher order

When computing the delta between the visible and the last saved launcher
order state, following the reordering of launchers, the code was incorrectly
comparing resolved and unresolved (i.e., for config storage) launcher URLs.
This lead to an incorrect result and therefore pinned tasks jumping around
in the Task Manager applet.


(cherry picked from commit fa00ca6a012faab30a9596a50a1b82f02e3e5c4e)

M  +11   -1    libtaskmanager/tasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/2ea791b2fb6c125ea25258cbbcf4ae60daef460a