Bug 487462 - Reordering the icons in the taskbar makes icons from another activity to replace some of the current activity taskbar icons
Summary: Reordering the icons in the taskbar makes icons from another activity to repl...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (other bugs)
Version First Reported In: 6.0.4
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-24 07:43 UTC by Benjamin Dedieu
Modified: 2025-04-16 01:23 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Video showing the wrong taskbar icons bug (394.55 KB, video/webm)
2024-05-24 07:43 UTC, Benjamin Dedieu
Details
Fedora 40 running in KVM, Plasma 6.1.3, Framework 6.4.0, Wayland (325.87 KB, video/webm)
2024-08-02 16:33 UTC, Michael
Details
Kubuntu 24.04 on bare metal, Plasma 5.27.11, Framework 5.115.0, X11 (334.49 KB, video/webm)
2024-08-02 16:35 UTC, Michael
Details
Neon User 240801_0717 on KVM, Plasma 6.1.3, Framework 6.4.0, Wayland (300.47 KB, video/webm)
2024-08-02 16:37 UTC, Michael
Details
Nobara40 on bare metal, Plasma 6.1.3, Framework 6.4.0, Wayland (582.28 KB, video/webm)
2024-08-02 16:38 UTC, Michael
Details
OpenSuse Tumbleweed on kvm, Plasma 6.1.3, Framework 6.4.0, X11 (587.87 KB, video/webm)
2024-08-02 16:40 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Dedieu 2024-05-24 07:43:36 UTC
Created attachment 169760 [details]
Video showing the wrong taskbar icons bug

SUMMARY
In the case where you have 2 activities with different icons in the plasma icon task manager, when trying to move an icon at another placement in the taskbar, all the icons placed after the new placement are replaced by icons from the other activity taskbar. In fact not only the icons are replaced, but all the desktop shortcut, meaning clicking on the wrong icon will also  bring you to the corresponding wrong application.

STEPS TO REPRODUCE
1. Create a new activity
2. Pin an application only on the current activity taskbar 
3. Go to the other activity
4. Pin another application only on the current activity taskbar
5. Move the icon to another place in the taskbar

OBSERVED RESULT
The icons following the new placement are replaced by icons from the other activity. (see video attached)

EXPECTED RESULT
The icons should not be replaced.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.5.0-35-lowlatency (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa Intel® Graphics
Comment 1 Benjamin Dedieu 2024-06-22 13:31:38 UTC
I  think I can help to correct the bug, as I have some programming knowledge and I am ready to take some time to look at it. 
Do someone has an idea of where I should start the investigation ? And where to find the code for the task icon manager ?
Comment 2 Ismael Asensio 2024-06-24 11:57:13 UTC
(In reply to Spinybuddy662 from comment #1)
> I  think I can help to correct the bug, as I have some programming knowledge
> and I am ready to take some time to look at it. 
> Do someone has an idea of where I should start the investigation ? And where
> to find the code for the task icon manager ?

Nice!

The backend model for the tasks is in plasma-workspace/libtaskmanager: https://invent.kde.org/plasma/plasma-workspace/-/tree/master/libtaskmanager
And the frontend applet in plasma-desktop/applets/taskmanager: https://invent.kde.org/plasma/plasma-desktop/-/tree/master/applets/taskmanager

This looks like some bad update of the filter model (which should filter out by activity) when a task is moved, so the problem could be in either of them. 
Happy hacking!
Comment 3 Michael 2024-08-02 16:33:25 UTC
Created attachment 172216 [details]
Fedora 40 running in KVM, Plasma 6.1.3, Framework 6.4.0, Wayland

I'm able to reproduce the problem in this environment:
Fedora 40 running in KVM
Plasma 6.1.3
Framework 6.4.0
Wayland
Comment 4 Michael 2024-08-02 16:35:12 UTC
Created attachment 172217 [details]
Kubuntu 24.04 on bare metal, Plasma 5.27.11, Framework 5.115.0, X11

I was *NOT* able to reproduce the problem here
Kubuntu 24.04 on bare metal
Plasma 5.27.11
Framework 5.115.0
X11
Comment 5 Michael 2024-08-02 16:37:02 UTC
Created attachment 172218 [details]
Neon User 240801_0717 on KVM, Plasma 6.1.3, Framework 6.4.0, Wayland

I was able to reproduce the problem here:
Neon User 240801_0717 on KVM
Plasma 6.1.3
Framework 6.4.0
Wayland
Comment 6 Michael 2024-08-02 16:38:44 UTC
Created attachment 172219 [details]
Nobara40 on bare metal, Plasma 6.1.3, Framework 6.4.0, Wayland

I was able to reproduce the problem here:
Nobara40 on baremetal
Plasma 6.1.3 
Framework 6.4.0
Wayland
Comment 7 Michael 2024-08-02 16:40:13 UTC
Created attachment 172220 [details]
OpenSuse Tumbleweed on kvm, Plasma 6.1.3, Framework 6.4.0, X11

I was *NOT* able to reproduce the problem here:
OpenSuse Tumbleweed on kvm, 
Plasma 6.1.3, 
Framework 6.4.0, 
X11
Comment 8 Michael 2024-08-02 16:42:12 UTC
I've been experiencing this problem and spent some time tracking down variables. I tested in a variety of environments to see how much I could reproduce the issue. I captured video of several situations and I believe the common contributor is Wayland.
Comment 9 TraceyC 2024-08-09 20:28:58 UTC
I came across this while testing Bug 466649 on git-master
Comment 10 Benjamin Dedieu 2024-08-16 13:33:25 UTC
I did some tests about the bug: 

1. It might be relevant to note that, after experiencing the bug on one activity, moving to another virtual desktop inside the activity or moving back and forward to another activity seems to solve partially the bug. Here is an example how to reproduce this.
- prepare at least 2 activities with different task bar icons (I did not test with icons pined to both activities), for example activity 1 with icons A, B, C and D and activity 2 with icons A', B', C' and D'.
- move icon D before icon B : bug appears and icon from the other activity pop up in place of B, C and D.
- change virtual desktop (or move to another activity and back to our activity) : bug disappeared icons are ordered as asked before : A, D, B, C.
- Then, reordering the icons in that activity (whatever the virtual desktop) seems to work fine (or at least it only mess with icons from the same activity and the icons from other activities don't pop up anymore).
- Going to another activity and going back to our activity re-initialize the thing, and the bug reappears when reordering the icons.

2 .I recently changed from Neon to Fedora40 and the bug is also there with kde 6.1.4.

3. With n number of activities, the bug seems to affect the icons of all the activities. When reordering the icons on activity n, the icons from the activity n-1 in the list of activities (the list we see when doing ALT+D,ALT+A on the desktop) pop up, then if we reorder the icon again and again the icons of the n-2 pop up, then n-3 etc... But this has not been extensively tested and things get more complicated when the activities have not the same number of icons, if the tasks corresponding to icons are enabled or not, it some icons are shared between activities...
Comment 11 Benjamin Dedieu 2024-08-16 14:48:07 UTC
(In reply to Ismael Asensio from comment #2)
> (In reply to Spinybuddy662 from comment #1)
> > I  think I can help to correct the bug, as I have some programming knowledge
> > and I am ready to take some time to look at it. 
> > Do someone has an idea of where I should start the investigation ? And where
> > to find the code for the task icon manager ?
> 
> Nice!
> 
> The backend model for the tasks is in plasma-workspace/libtaskmanager:
> https://invent.kde.org/plasma/plasma-workspace/-/tree/master/libtaskmanager
> And the frontend applet in plasma-desktop/applets/taskmanager:
> https://invent.kde.org/plasma/plasma-desktop/-/tree/master/applets/
> taskmanager
> 
> This looks like some bad update of the filter model (which should filter out
> by activity) when a task is moved, so the problem could be in either of
> them. 
> Happy hacking!

Thank you for pointing me in the right direction in the code. Sorry for the  late reply. Unfortunately, this year has been quite overwhelming for me, and I suppose I won't have much time to delve deeply into the taskmanager code or fully understand how the engine works until next year.

Still is there any documentation or a README that explains the basics of how the taskmodel works? Specifically, I'm looking for information on whether there are objects like 'launcher' or 'tasks' and where are they declared. I noticed that the order in the taskbar seems to be controlled by an index, but I'm not entirely sure I understand how this index works.

However, I did observe that when we don't reorder the icons, the tasks are properly filtered when changing activities. This leads me to think the issue might not be with the filter model, but more with the methods which control the reordering, possibly within `taskmodel::move()`, or `taskmodel::syncLaunchers()` if I've understood correctly.