Commit 79ff3870 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Only accept mouse press in appletslayout if something is in edit mode

Otherwise we block left mouse press from triggering containment actions.

BUG: 413104

(cherry picked from commit ff5b23b7)
parent 1eb0fa12
Pipeline #235620 passed with stage
in 8 minutes and 30 seconds
......@@ -600,6 +600,16 @@ void AppletsLayout::mousePressEvent(QMouseEvent *event)
// Only accept synthesized events i.e. touch events, because we only want
// to support press-and-hold. Click-and-hold is weird. See 457979.
if (!(event->source() == Qt::MouseEventSynthesizedBySystem || event->source() == Qt::MouseEventSynthesizedByQt)) {
const auto children = childItems();
// If any container is in edit mode, accept the press event so we can
// cancel the edit mode. If not, don't accept the event so it can be
// passed on to other parts.
if (std::none_of(children.begin(), children.end(), [](QQuickItem *child) {
auto container = qobject_cast<ItemContainer *>(child);
return container ? container->editMode() : false;
})) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment