Start drag with press and hold on touch events
ClosedPublic

Authored by davidedmundson on Mar 8 2017, 1:58 AM.

Details

Summary

This patch consists of two changes:

  • starting drags on press and hold
  • not starting drags when the event is from a touch event

This means a user can scroll on a widget explorer with a touch screen
correctly without it immediately starting a drag, but can still drag an
item using a press and hold pattern.

BUG: 368698

Test Plan

Scrolled in Widget Explorer
Added widget with press and hold

Surprisingly that's the only Plasma usage of DragArea.

Diff Detail

Repository
R296 KDeclarative
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Mar 8 2017, 1:58 AM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptMar 8 2017, 1:58 AM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
broulik added a subscriber: broulik.Mar 8 2017, 4:55 PM

Kickoff also uses DragArea iirc, I tend to use Qt's own Drag thing, though, but if we have better/proper touchscreen support in there then, might be worth re-considering.

Kicker uses a normal mouse area for drag starting, then a different plasmoid specific C++ helper for mimedata

hein added a subscriber: hein.Mar 8 2017, 5:53 PM

So do Task Manager and Folder View. Because DragArea is kind of broken and will crash Plasma if it's deleted during the drag (which happens quite often when you remove something by DND).

Even Qt's own Drag attached property crashes when the item it's attached to is deleted as I had to experience, cf D4976

mart added a subscriber: mart.Mar 9 2017, 3:51 PM

the discussion seems to me a bit unrelated with the review in itself.
for me the patch is ok, +1

mart accepted this revision.Jun 5 2017, 12:18 PM

good idea!

This revision is now accepted and ready to land.Jun 5 2017, 12:18 PM
This revision was automatically updated to reflect the committed changes.