Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #291089: Leaving edit mode requires second click #5154

Merged
merged 1 commit into from
Jun 22, 2019

Conversation

mattmcclinch
Copy link
Contributor

@mattmcclinch mattmcclinch commented Jun 21, 2019

Resolves: https://musescore.org/en/node/291089.

Switching to edit mode caused mouseTracking to be set to true, and a mouseMove event while in edit mode causes the state to switch to DRAG_EDIT. The first click switches from DRAG_EDIT to EDIT. The second click switches from EDIT to NORMAL.

When switching to edit mode, it is only necessary to set mouseTracking to true if we are editing text. This is so the mouse cursor will automatically update when it enters and leaves the text area.

If mscoreState() is called before the state variable is updated, the result will be based on the previous state.

@dmitrio95
Copy link
Contributor

The change concerning mouse tracking is totally correct. However you also included a change that reverts #4029 — I believe for the reasons described in this comment. However this causes a crash similar to that described in the issue 276539 to re-appear so it is still necessary to keep the fix from #4029 to prevent similar crashes. To reproduce it with this patch:

  1. Download the test file from this issue comment.
  2. Add a slur to the same place as shown in the gif in that comment, double-click it.
  3. Drag the end grip to the second system in that score (as opposed to dragging to the first staff of the same system in the demonstration in the issue comment).

So I believe doing startEdit() call on transition from non-textual drag edit to edit mode should still be kept. The reason seems to be the same as I described in #4029: it is necessary to get the code inside Element::startEdit() be executed in order to initialize ElementEditData that may be used later.

@mattmcclinch
Copy link
Contributor Author

Okay, I took out that change. I believe I have the right fix for the issue you mention which also allows us to revert #4029, but I can submit that as a separate PR once this is merged.

@dmitrio95 dmitrio95 merged commit 7acdcfb into musescore:master Jun 22, 2019
@mattmcclinch
Copy link
Contributor Author

See #5156 for the "separate PR" I was talking about.

anatoly-os pushed a commit that referenced this pull request Jun 22, 2019
fix #291089: Leaving edit mode requires second click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants