Bug 435798

Summary: ApplicationWindow().overlay continues to block wheelEvents when a Popup is closed with a mouse click
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: elman <elman>
Component: generalAssignee: Marco Martin <notmart>
Status: CONFIRMED ---    
Severity: normal CC: kdelibs-bugs-null, nate, nsprangers
Priority: NOR    
Version First Reported In: 5.81.0   
Target Milestone: Not decided   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Diff for EntryScreenshots.qml

Description elman 2021-04-16 07:34:52 UTC
SUMMARY
When browsing new stuff, mouse wheel sometimes doesn't work to scroll content.

STEPS TO REPRODUCE
1. Open System Settings / KRunner
2. Click Get New Plugins...
3. Click any item with image
4. Confirm that mouse wheel scrolling works
5. Click image
6. Click outside the image to close it
7. Try mouse wheel scrolling and it doesn't work now

OBSERVED RESULT
Mouse wheel scrolling doesn't work when it should.

EXPECTED RESULT
Mouse wheel scrolling should work all the time.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Comment 1 elman 2021-04-16 07:37:16 UTC
Also

8. Click Navigate back button
9. Mouse wheel scrolling in items list doesn't work either.

Scrolling can be restored when I click on image again and use Esc key to close image.
Comment 2 Nate Graham 2021-04-16 18:20:37 UTC
Hmm, cannot reproduce.
Comment 3 elman 2021-04-19 21:11:07 UTC
I tried it on 2 different computers (another Manjaro and Arch) and I can reproduce it on both of them.
Comment 4 nsprangers@gmail.com 2021-10-02 06:51:37 UTC
I can confirm. Happens with anything that uses knewstuff.

Scrollwheel function is restored by clicking any item then returning to the list.

OpenSUSE Tumbleweed: KDE Unstable
knewstuff: 5.86.0git.20210929T215207~de50a5a0-ku.11.1
Comment 5 nsprangers@gmail.com 2021-10-02 06:53:04 UTC
Meant to add: X11 session
Comment 6 nsprangers@gmail.com 2021-10-02 09:53:49 UTC
Created attachment 142081 [details]
Diff for EntryScreenshots.qml

The issue seems to be that applicationWindow().overlay continues to block wheelEvents when the Popup (EntryScreenshots.qml) is closed with a mouse click.

The bug is not present when:
 - hit escape to close the Popup
 - set `modal: false`
 - remove `parent: applicationWindow().overlay`
 - set `closePolicy: Popup.CloseOnEscape | Popup.CloseOnReleaseOutside` (attached diff)

The default closePolicy would be Popup.CloseOnEscape | Popup.CloseOnPressOutside. The attached diff "fixes" the issue, but it seems like the default should work.
https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#closePolicy-prop

I don't know enough about QML, so that's as far as I got.
Comment 7 Nate Graham 2021-10-04 15:39:06 UTC
Nice investigation. I'm also not sure which would be the correct fix for this, but it would be best to find where the bug is somewhere in Kirigami so we don't need to add workarounds in code that uses it.