Fix drag being initiated by double click on a panel item when cursor is on the edge of a screen

Original commit message(s)

  • Fix drag being initiated by double click on a panel item when cursor is on the edge of a screen

We need to adjust the position of QEvent::MouseButtonDblClick too. QGuiApplication synthetizes QEvent::MouseButtonDblClick after QEvent::MouseButtonPress which Qt Quick's DragHandler also receives. If QEvent::MouseButtonDblClick's positions is not adjusted DragHandler will see the difference between QEventPoint's scenePosition and scenePressPosition (which seems to be taken from previous QEvent::MouseButtonPress?), and initiate drag.

BUG: 501922

(For future reference, follow the guidelines at https://cbea.ms/git-commit/#seven-rules)

Reason for the change

When user double clicks on panel at the edge of the screen, drag&drop action is initiated at the same time as actual double click. The reason is that PanelView's code for "snapping" mouse events to the panel items when cursor is at the edge of the screen didn't account for QEvent::MouseButtonDblClick event which is also handler by Qt Quick's DragHandler.

Test plan

I checked that double click doesn't initiate drag anymore on my machine and nothing seems to be broken.

Screenshots or screen recordings

Before After
before after

Bugs fixed

BUG: 501922

Merge request reports

Loading
Loading