SUMMARY I've created a widget with window controls. It has a mode to show controls for last activated task instead of active, this option works well with multiple displays. The mode based on TasksModel sorted by SortLastActivated. However, if you have some tasks opened yesterday at some time, they will always be above any tasks opened today before this time. Formaly, everything is correct, sorted by timestamp according to the documentation. But the model is not sorted in expected order. STEPS TO REPRODUCE 1. Install "Application Title Bar" widget to a panel. 2. Switch "Active task source" option to "Last active task". 3. Open first task. 4. Wait until the next day. 5. Open second task. OBSERVED RESULT Controls are showed for the first task. EXPECTED RESULT Controls are showed for the second task. SOFTWARE/OS VERSIONS Operating System: KDE neon 6.0 KDE Plasma Version: 6.1.5 KDE Frameworks Version: 6.6.0 Qt Version: 6.7.2 Kernel Version: 6.8.0-40-generic (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 PRO 4650U with Radeon Graphics Memory: 14.9 GiB of RAM Graphics Processor: AMD Radeon Graphics Manufacturer: LENOVO Product Name: 20UH001JRT System Version: ThinkPad T14s Gen 1 ADDITIONAL INFORMATION https://invent.kde.org/plasma/plasma-workspace/-/blob/master/libtaskmanager/waylandtasksmodel.cpp#L415
Nice investigation. Would you like to submit a patch?
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4986
Git commit 98469ba87c48b3c12b5947d6f7fbebf7f771d2bc by Fushan Wen, on behalf of Anton Kharuzhy. Committed on 14/12/2024 at 12:57. Pushed by fusionfuture into branch 'master'. libtaskmanager: use QDateTime instead of QTime for lastActivated TaskManager model can have rows sorted in wrong order if some tasks were activated yesterday and sort mode is SortLastActivated. FIXED-IN: 6.2.5 M +3 -3 libtaskmanager/autotests/xwindowtasksmodeltest.cpp M +3 -3 libtaskmanager/taskgroupingproxymodel.cpp M +12 -12 libtaskmanager/tasksmodel.cpp M +4 -3 libtaskmanager/waylandtasksmodel.cpp M +3 -2 libtaskmanager/xwindowtasksmodel.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/98469ba87c48b3c12b5947d6f7fbebf7f771d2bc
Git commit 1b6359a4db1670b01f05aabb24735879ed629261 by Fushan Wen. Committed on 14/12/2024 at 13:01. Pushed by fusionfuture into branch 'Plasma/6.2'. libtaskmanager: use QDateTime instead of QTime for lastActivated TaskManager model can have rows sorted in wrong order if some tasks were activated yesterday and sort mode is SortLastActivated. FIXED-IN: 6.2.5 (cherry picked from commit 98469ba87c48b3c12b5947d6f7fbebf7f771d2bc) b3d7eb9c #493724: TaskManager::TasksModel: use QDateTime instead of QTime for lastActivated fb4f2f06 Merge branch plasma-workspace:master into master Co-authored-by: Anton Kharuzhy <publicantroids@gmail.com> M +3 -3 libtaskmanager/autotests/xwindowtasksmodeltest.cpp M +3 -3 libtaskmanager/taskgroupingproxymodel.cpp M +12 -12 libtaskmanager/tasksmodel.cpp M +4 -3 libtaskmanager/waylandtasksmodel.cpp M +3 -2 libtaskmanager/xwindowtasksmodel.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/1b6359a4db1670b01f05aabb24735879ed629261