Leaving edit mode requires second click

• Jun 21, 2019 - 15:27
Reported version
3.1
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

This is a recent regression as of 75c33e2.

Right-click any element in any score, and choose "Edit Element". Then move the mouse and click anywhere on the canvas. Notice that the ScoreView is still in edit mode, and it will require a second click to return to normal mode. However, if you don't move the mouse first, or if you enter edit mode by double-clicking on an element, it will only require a single click to return to normal mode.


Comments

Status fixed active

I am reopening this issue because it still exists for text elements. In fact, there is more to it. To see what I mean, first right-click a text element and choose "Edit Element". Then move the mouse into the text box. The text between the mouse cursor and the text cursor becomes selected. Now move the mouse around inside the text box. The selection changes based on the position of the mouse relative to the initial position of the text cursor. This would be expected if any mouse buttons were pressed, but they are not.

This issue is observable on macOS and Linux, but not on Windows. The reason for this is that on macOS and Linux, Qt never sends a mouse release event to the ScoreView for the right mouse button, and so editData.buttons is not reset to Qt::NoButton. Changing to text edit mode causes mouse tracking to be turned on, and editData.buttons is still equal to Qt::RightMouseButton, and so the movement registers as a drag. This can be fixed by setting editData.buttons to Qt::NoButton in ScoreView::contextMenuEvent().

Fix version
3.2.0