Bug 513019 - b6dfe0b33ee2a2c5c8c227b3054dfbbbb0bf0d46 occasionally makes grouped tasks do nothing when clicked
Summary: b6dfe0b33ee2a2c5c8c227b3054dfbbbb0bf0d46 occasionally makes grouped tasks do ...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (other bugs)
Version First Reported In: 6.5.80
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Grégori MIGNEROT
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-12-06 19:25 UTC by Nate Graham
Modified: 2025-12-07 15:54 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2025-12-06 19:25:55 UTC
Since b6dfe0b33ee2a2c5c8c227b3054dfbbbb0bf0d46 was merged, occasionally (like, once every 5 or 6 days) I end up in a situation where clicking on a grouped task does not raise any of its windows; instead, the following is printed to the console:

2:15:38 engine plasmashell[113060]: "Could not convert argument 0 from undefined to QModelIndex"
Dec 06 12:15:38 engine plasmashell[113060]:          "activateTask@file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/code/tools.js:136"
Dec 06 12:15:38 engine plasmashell[113060]:          "leftClick@file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:422"
Dec 06 12:15:38 engine plasmashell[113060]:          "@file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:416"
Dec 06 12:15:38 engine plasmashell[113060]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/code/tools.js:136: TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed.

This is issue is difficult to reproduce, and I haven't identified the pattern yet. Most of the time, clicking on grouped tasks works to raise the most recently-used window.

If it helps, there are never any full-screen windows open when the issue happens.


Operating System: KDE Linux 2025-12-05
KDE Plasma Version: 6.5.80
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.17.9-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon™ 780M Graphics
Memory: 17 GB of RAM (16.0 GB usable)
Graphics Processor: AMD Radeon 780M Graphics
Comment 1 Grégori MIGNEROT 2025-12-06 20:42:02 UTC
Could reproduce it, when a window has never been focused its lastActivated time is undefined, so when none of the windows in the group were ever focused it can't find a top one.
Comment 2 Grégori MIGNEROT 2025-12-07 08:44:23 UTC
— Reproducible more easily by restarting a running plasmashell
Comment 3 Nate Graham 2025-12-07 15:54:55 UTC
Git commit 27057aef0c8a3abcac9e698d894273b2a250de5f by Nate Graham, on behalf of Grégori Mignerot.
Committed on 07/12/2025 at 15:54.
Pushed by ngraham into branch 'master'.

applets/taskmanager: Fix last-used task selection

The LastActivated property is undefined until a task is activated at least once. So when
no task in the group was ever activated, it can't find the top one using LastActivated.
This regression was introduced by !3307, and can be reproduced by clicking on a grouped
task right after restarting a running plasmashell.

To fix this, default to StackingOrder in that case. 

M  +44   -25   applets/taskmanager/package/contents/ui/code/tools.js

https://invent.kde.org/plasma/plasma-desktop/-/commit/27057aef0c8a3abcac9e698d894273b2a250de5f