Skip to content

appDisplay: Only use dragMonitor for one icon at a time

Instead of adding a dragMonitor for every icon in the grid as soon as one icon is getting dragged, only add a dragMonitor for the icon that is currently being dragged over (ie. the current drag-target). With a large number of icons in the iconGrid, this should significantly reduce lags while dragging.

We can do this by detecting the DnD-entering of an icon or folder using the handleDragOver() callback of drag-targets, adding the dragMonitor because we know an icon is hovering above the drag-target and then detecting the DnD-leaving of the drag-target by using the dragMotion() handler, where we remove the dragMonitor again as soon as the targetActor is no longer our actor (ie. the drag-target).

Merge request reports