Avoid cursor glitch after trying to drag an image onto itself
ClosedPublic

Authored by rkflx on Jun 25 2018, 9:47 PM.

Details

Summary

Before showing the cursor for dragging an image in View mode, the
ClosedHandCursor for panning is shown due to startDragDistance().
This can be observed when slowly starting to drag. Once the user
released the mouse button within the bounds of the view and thus
finished the drag, the ClosedHandCursor was still shown, while
OpenHandCursor would have been the correct cursor to display.

qDebug() shows that the cursor is correctly (re)set, but somehow the
change takes effect only after moving the mouse again. A workaround
which seems to fix the problem is to reset the panning cursor before
initiating the drag, which then sets and resets the dragging cursor
correctly.

Depends on D13725

Test Plan

Slowly initiate a drag so the ClosedHandCursor is shown. Release the
mouse button without moving the mouse, and observe that the cursor
correctly resets to OpenHandCursor. There should be no additional
flickering during the whole operation.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkflx requested review of this revision.Jun 25 2018, 9:47 PM
rkflx created this revision.
huoni accepted this revision.Jul 8 2018, 12:28 AM
huoni added a subscriber: huoni.

Nice, such a simple fix!

LGTM :)

This revision is now accepted and ready to land.Jul 8 2018, 12:28 AM
This revision was automatically updated to reflect the committed changes.