Bug 445512 - When switching between categories after scrolling down, random app from the last category appears in the next category
Summary: When switching between categories after scrolling down, random app from the l...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) (show other bugs)
Version: 5.23.3
Platform: Arch Linux Linux
: HI normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
: 445602 453080 453728 472822 483558 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-11-15 05:12 UTC by Jin Liu
Modified: 2024-04-08 19:19 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.4


Attachments
KDEConnect from "Internet" category appears in "Education" (693.76 KB, image/jpeg)
2021-11-15 05:13 UTC, Jin Liu
Details
Screencast of the bug (3.50 MB, video/x-matroska)
2021-11-24 03:44 UTC, Jin Liu
Details
Screencast of the same bug as in bug 445602 (1.75 MB, video/x-matroska)
2021-11-24 03:56 UTC, Jin Liu
Details
Same bug, in Neon:unstable (1.60 MB, video/x-matroska)
2021-11-24 05:11 UTC, Jin Liu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jin Liu 2021-11-15 05:12:11 UTC
SUMMARY

STEPS TO REPRODUCE
1. Open Kickoff
2. Select a category with lots of items, so it has a scroll bar. (e.g. "Internet")
3. Use mouse wheel to scroll up and down a few times.
4. Mouse hover to select the next category. (e.g. "Education")

OBSERVED RESULT
One random item from the previous category appears at the top of the current category.

EXPECTED RESULT
No misplaced items.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 21.08.3
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Jin Liu 2021-11-15 05:13:41 UTC
Created attachment 143560 [details]
KDEConnect from "Internet" category appears in "Education"
Comment 2 Jin Liu 2021-11-19 04:39:13 UTC
Side note: As in the attachment, clicking the wrong "KDEConnect" item still launches the correct "Step" app which should be there. Seems it's only a rendering problem.
Comment 3 Nate Graham 2021-11-23 22:17:17 UTC
*** Bug 445602 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2021-11-23 22:18:55 UTC
Cannot reproduce, and the reporter of duplicate Bug 44560 said that the Frameworks 5.88 upgrade fixed it for them. Can you confirm that?
Comment 5 Jin Liu 2021-11-24 03:44:51 UTC
Created attachment 143887 [details]
Screencast of the bug
Comment 6 Jin Liu 2021-11-24 03:51:51 UTC
My framework version is 5.88. I recorded a screencast of the bug (attachment above).
Tried changing global zoom 2.5x and 1x, panel left and bottom, locale zh_CN and en_US, all have this problem.
In zh_CN locale, moving from "All Applications" to the category immediately below does have the same problem as in bug 445602, but not in en_US. However, as you can see in the attachment, it still happens in other categories.
Comment 7 Jin Liu 2021-11-24 03:56:44 UTC
Created attachment 143888 [details]
Screencast of the same bug as in bug 445602
Comment 8 Jin Liu 2021-11-24 05:09:04 UTC
I can reproduce this bug in the latest KDE Neon docker image:
https://hub.docker.com/layers/kdeneon/plasma/unstable/images/sha256-87c661b4a39bdeb66b1bd27e888e658c954518c21a33e2e182b868c141dcefc8?context=explore

Step:
1. Install neondocker as in https://community.kde.org/Neon/Docker.
2. Run neondocker.
3. Open kickoff.
4. Click "All Applications" and move mouse wheel up and down.
5. Hover over "Graphics". The 1st entry is wrong.
Comment 9 Jin Liu 2021-11-24 05:11:55 UTC
Created attachment 143891 [details]
Same bug, in Neon:unstable
Comment 10 Nate Graham 2021-11-24 19:43:44 UTC
Weird. Thanks for the additional info. Still cannot reproduce. :(
Comment 11 Jin Liu 2021-12-08 04:32:58 UTC
Found a "workaround": force the code to re-create listview when switching categories, instead of reusing views and restoring bindings.

diff --git a/applets/kickoff/package/contents/ui/ApplicationsPage.qml b/applets/kickoff/package/contents/ui/ApplicationsPage.qml
index 0987ce175..4403796e9 100644
--- a/applets/kickoff/package/contents/ui/ApplicationsPage.qml
+++ b/applets/kickoff/package/contents/ui/ApplicationsPage.qml
@@ -106,7 +106,7 @@ BasePage {
                     // TODO: maybe find a way to have a list view with grids in each section?
                     stackView.replace(applicationsListViewComponent)
                 } else if (root.sideBarItem.currentIndex > 1
-                    && stackView.currentItem.objectName !== stackView.preferredAppsViewObjectName) {
+                    /*&& stackView.currentItem.objectName !== stackView.preferredAppsViewObjectName*/) {
                     stackView.replace(stackView.preferredAppsViewComponent)
                 }
             }

However this is only a hack. It causes visible flicking. So I guess that's why views are reused there in the first place.

But that's a hint that there might be some timing/sequencing issue among RestoreBinding, currentItem.forceActiveFocus and mouse hovering, which caused "currentItem" drawn in the old model while the rest in the new model?
Comment 12 Jin Liu 2022-01-14 05:42:41 UTC
Checked in 5.24 beta. Same problem.
Comment 13 Nate Graham 2022-07-05 16:57:04 UTC
*** Bug 453080 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2022-07-05 16:58:33 UTC
*** Bug 453728 has been marked as a duplicate of this bug. ***
Comment 15 Max 2023-04-12 09:28:35 UTC
Still having this problem with the following configuration:

Operating System: Fedora Linux 37
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.10-200.fc37.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × Intel® Core™ i7-10870H CPU @ 2.20GHz
Memory: 15.4 ГиБ of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: Dell Inc.
Product Name: Dell G15 5510
Comment 16 Nate Graham 2023-09-07 19:48:41 UTC
*** Bug 472822 has been marked as a duplicate of this bug. ***
Comment 17 Patrick Silva 2024-03-15 14:00:02 UTC
*** Bug 483558 has been marked as a duplicate of this bug. ***
Comment 18 Patrick Silva 2024-03-15 14:00:55 UTC
Still an issue on Plasma 6.

Operating System: Arch Linux 
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Graphics Platform: Wayland
Comment 19 Bug Janitor Service 2024-04-04 13:19:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2167
Comment 20 Nate Graham 2024-04-08 18:05:55 UTC
Git commit aa8a1fbf4b8e46039b809620071728c0692b49fa by Nate Graham, on behalf of David Redondo.
Committed on 08/04/2024 at 18:04.
Pushed by ngraham into branch 'master'.

applets/kickoff: Disable reusing items

Together with switching models of the view like kickoff does
reusing delegates confuses Qt. Debugging the a wrong entry
reveals that the 'model' property inside the delegate and the
required properties still refer to the previous model.
FIXED-IN:6.0.4

M  +1    -1    applets/kickoff/package/contents/ui/KickoffListView.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/aa8a1fbf4b8e46039b809620071728c0692b49fa
Comment 21 Nate Graham 2024-04-08 19:19:18 UTC
Git commit a614a873f9dacd88324d735de96670bb02821071 by Nate Graham, on behalf of David Redondo.
Committed on 08/04/2024 at 18:06.
Pushed by ngraham into branch 'Plasma/6.0'.

applets/kickoff: Disable reusing items

Together with switching models of the view like kickoff does
reusing delegates confuses Qt. Debugging the a wrong entry
reveals that the 'model' property inside the delegate and the
required properties still refer to the previous model.
FIXED-IN:6.0.4


(cherry picked from commit aa8a1fbf4b8e46039b809620071728c0692b49fa)

M  +1    -1    applets/kickoff/package/contents/ui/KickoffListView.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/a614a873f9dacd88324d735de96670bb02821071