[listitem] swiping doesn't work when a mousearea on top doesn't accept the mouse event
Bug #1484545 reported by
Andrea Bernabei
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
High
|
Zsombor Egri |
Bug Description
staging r1603
ListItem { MouseArea { onPressed: mouse.accepted = false } }
When a MouseArea doesn't accept a mouse event, the ListItem becomes non-swipable.
After discussing this with kalikiana, we agreed that this behaviour is not intended and should be fixed.
Not accepting a mouse event from within the listitem shouldn't stop the swiping mechanism from activating.
The same applies to ListItem highlight or click, they should not be stopped by a MouseArea which is inside the listitem if that mouse area doesn't accept the mouse event
Related branches
lp:~zsombi/ubuntu-ui-toolkit/listItemHandleUnacceptedMouseEvent
- PS Jenkins bot: Approve (continuous-integration)
- Cris Dywan: Approve
-
Diff: 121 lines (+35/-18)4 files modifiedsrc/Ubuntu/Components/plugin/uclistitem.cpp (+6/-16)
src/Ubuntu/Components/plugin/uclistitem_p.h (+1/-1)
tests/unit_x11/tst_components/ListItemTestCase.qml (+1/-0)
tests/unit_x11/tst_components/tst_listitem_extras.qml (+27/-1)
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
importance: | Medium → High |
assignee: | nobody → Zsombor Egri (zsombi) |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | Confirmed → In Progress |
To post a comment you must log in.
We have a problem here: there's no way for us to know whether the overlaid MouseArea did or did not accept mouse events. childMouseEvent Filter acts prior the MouseArea's mousePressed() is handled, so the event is still in accepted state. As result of onPressed: mouse.accepted = false, ListItem is also getting the mouse event, but the accepted state is still true.
We could rely on mouseEvent() being caught when overlaid items do not accept mouse events, after all all accepted events are suppressed and ListItem's event handler won't be called anymore...