Only accept press-and-hold to enter Edit Mode, not click-and-hold

Press-and-hold is fairly common on touch UIs, but click-and-hold is a
very rare interaction. As a result, the user is much more likely to
enter Edit Mode accidentally while trying to drag something on the
desktop than they are to know that click-and-hold works here and do
it intentionally.

Let's disable click-and-hold and only enter Edit Mode with a
press-and-hold using a touch device. For pointing device users, there
are already multiple context menus items that will let them enter Edit
Mode.

BUG: 457979
FIXED-IN: 5.26
wilder-5.26
Nate Graham 4 years ago
parent 0e06391396
commit 3f612a31a0
  1. 6
      components/containmentlayoutmanager/appletslayout.cpp

@ -597,6 +597,12 @@ void AppletsLayout::mousePressEvent(QMouseEvent *event)
{
forceActiveFocus(Qt::MouseFocusReason);
// 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)) {
return;
}
if (!m_editMode && m_editModeCondition == AppletsLayout::Manual) {
return;
}

Loading…
Cancel
Save