Leaving edit mode requires second click
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.
Fix version
3.2.0
Comments
See https://github.com/musescore/MuseScore/pull/5154.
Fixed in branch master, commit 747c8f8b74
fix #291089: Leaving edit mode requires second click
Fixed in branch master, commit 7acdcfb425
_Merge pull request #5154 from mattmcclinch/291089-mouse-tracking
fix #291089: Leaving edit mode requires second click_
Fixed in branch 3.2, commit 65a28f22f7
_Merge pull request #5154 from mattmcclinch/291089-mouse-tracking
fix #291089: Leaving edit mode requires second click_
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().
Isn't that what #291199: [Regression] Context menu ALWAYS broken (under Windows?) is about?
See https://github.com/musescore/MuseScore/pull/5161.
It is certainly related to #291199: [Regression] Context menu ALWAYS broken (under Windows?), but it is a different issue.
Fixed in branch master, commit af9c7d5a9e
fix #291089: Leaving edit mode requires second click
Fixed in branch master, commit 38dab17ae7
_Merge pull request #5161 from mattmcclinch/291089-context-menu
fix #291089: Leaving edit mode requires second click_
Fixed in branch 3.2, commit 7ff1323d4c
_Merge pull request #5161 from mattmcclinch/291089-context-menu
fix #291089: Leaving edit mode requires second click_
Automatically closed -- issue fixed for 2 weeks with no activity.