Bug 435523

Summary: Clicking on darkened area no longer closes OverlaySheet
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Nate Graham <nate>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal Keywords: regression
Priority: VHI    
Version First Reported In: 5.80.0   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.82
Sentry Crash Report:

Description Nate Graham 2021-04-08 19:02:48 UTC
This used to work, but now it no longer does. You can only close the OverlaySheet by clicking on the close button or hitting the Escape key.

Reproducible in Discover and Kirigami Gallery.
Comment 1 Nate Graham 2021-04-08 19:07:06 UTC
git bisect says this was broken by https://invent.kde.org/frameworks/kirigami/-/commit/21de2a2912839a7076623910025ff88c5cc31c2e.
Comment 2 Nate Graham 2021-04-08 19:08:43 UTC
Marking as VHI since this breaks OverlaySheet quite terribly on mobile, where there is usually no close button and and no Esc key, so the expected way to close it tapping on the background, which no longer working.
Comment 3 David Edmundson 2021-04-15 15:32:34 UTC
got it.

the old code was:

        MouseArea{
            drag.filterChildren: true


filterchilren obviously only works if the other code was a child.
Comment 4 Bug Janitor Service 2021-04-15 15:38:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/279
Comment 5 Nate Graham 2021-04-19 14:22:43 UTC
Git commit e058f44960ba90b016a4c7238cb025e1928256e1 by Nate Graham, on behalf of David Edmundson.
Committed on 19/04/2021 at 14:21.
Pushed by ngraham into branch 'master'.

[OverlaySheet] Fix click to close

In 21de2a2912839a7076623910025ff88c5cc31c2e. the main item was changed
from a MouseArea to a FocusScope.

Moving the MouseArea to be a child doesn't work breaks the fact that it
filters the drag children.

This patch wraps the MouseArea round all the main contents again.

M  +325  -324  src/controls/templates/OverlaySheet.qml
A  +54   -0    tests/OverlayFocusTest.qml     [License: LGPL(v2.0+)]

https://invent.kde.org/frameworks/kirigami/commit/e058f44960ba90b016a4c7238cb025e1928256e1