Time signature replacement crashes if double-clicking first on it
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
Take the default score
Double click on the 4/4 time signature using mouse
Go to the Time Signature pallet
Double click on a replacement signature eg 3/4
Crashes.
Note. You have to double click on the default TS when selecting it. Single click select works fine.
Fix version
3.0.1
Comments
The normal (documented) procedure for changing time signature is either:
1) Select, ie one click, the time signature/measure/rest on the score + double-click in the palette
2) From the palette, drag and drop the new time signature onto measure/rest/existing time sig.
If by misunderstanding or clumsiness, the first step is: double-click on the time signature, that leads to crash (if second step is also by double-clicking)
Here is call stack:
assert failure with:
although i is 0 there. So what it seems is that
SysStaff* staff
is a bogus object...since the indexing of_staves[0]
is failing.In
StaffLines::pagePos()
object,this
is a valid pointer to a staff with 5 lines, butthis->system
is NULL. So need to figure out why system is NULL.would possibly doing a layout or update() fix this?
applyDrop() in palette.cpp seems to run fine.
I notice Palette::mousePressEvent() has an update(), but Palette::mouseDoubleClickEvent doesn't have an update().
well adding a score->update() to the end of Palette::applyPaletteElement() does the trick.
I notice there is a commented out mscore->endCmd() at the end of that function as a result of https://github.com/ericfont/MuseScore/commit/b0c317c71721913eaaa64f3d26…
I'm guessing normally endCmd would apply a score->update(). But I guess in lieu of that commented out endCmd(), applyPaletteElement() should still do an update().
well this bug is resolved with simply updating score at end of applyPaletteElement():
https://github.com/musescore/MuseScore/pull/4523
Who knows if it is really that simple.
As that earlier mentioned commit says it is called "fix #270381 Crash after using F2 to insert ü", I've just checked to make sure that I can still insert various symbols by opening master palette and double-clicking. So at least I believe I haven't broken what that commit tried to fix.
As mentioned in my PR I'm closing, the action needs to be undooable with a balanced endCmd
I was chatting with Johan Temmerman. I was asking about if it makes sense to disable the palette entirely while in edit mode. He made a counter suggestion:
[quote]I mean, if after editing an element I double click something on the palette, isn't that a clear enough intent of action that should in itself rather take us out of edit mode of that element and then apply the palette action?
As a user I'd get frustrated in having to click "somewhere else" first (for newbies) or hit Esc every time[/quote]
So that seems to maybe be a better way to deal with this crash: simply exit edit mode if use double-clicks palette.
I was also noting some funny behavior if double click a Measure Rest (entering edit mode) and then double-click system text in palette, the system text would appear to not be applied. But upon clicking the measure rest (exiting edit mode) and double-clicking system text in palette, it would notice two systems texts have been applied...which suggests that the earlier system text was actually applied, although maybe that measure wasn't updated so we didn't see it:
Anyway this leads me to think that would be better to simply exit edit mode when double-click on palette.
In reply to I was chatting with Johan… by ericfontainejazz
That's fine too, we do that often enough for other commands, forcing a return to normal mode before doing anything else.
Good. Submitted PR to exit edit mode on double-click palette: https://github.com/musescore/MuseScore/pull/4524
Seems to be working well (i.e. no crash or glitches). And I've verified though debugger that when I call
viewer->changeState(Ms::ViewState::NORMAL);
coming from edit mode that changeState does test for:and runs endsEdit() as I think is desired.
Although mattmcclinch says in https://github.com/musescore/MuseScore/pull/4524#issuecomment-450603804 that "I really do not think that this is the solution. Remember #3899 and all the problems it caused?"
Well I've tried to make a crash or break behavior, and haven't so far...and the following still work:
#275574: Dragging dynamic onto selected dynamic causes crash
#276974: Drum palette: Entering via mouse fails
#277536: Edit drumset palette is closed right after first click
#278099: Crash when inserting a symbol from master palette
Maybe if there are any specific types of things I should try testing, let me know...
another nice side effect of my PR that can apply accidentals to a note in edit mode by double-clicking from palette...couldn't do that before.
Thanks guys. I just replaced my beta with the 3.0 stable. It crashed again. Has the fix been included or an expected update later? Here's what I got on the screen when I went through the same process earlier
The proposed fix has not yet been merged.
Fixed in branch master, commit 7f9f1df8eb
fix #280830 exit edit mode if double-click palette
Previously, if user was in edit mode (by double-clicking an element in score), then applying palette elements by double-clicking would be problematic. This would be because Palette::applyPaletteElement() doesn't perform score->startCmd() before applying the element nor a score->endCmd() after applying the element, because it assumes that the score is already in a startCmd.
Exiting edit mode fixes #280830 which was a crash when applying a time signature from palette while in editmode. And fixes another glitch where applying system text from palette while in edit mode.
Turns out that ScoreView::editMode() encompasses more than just plane element edit, so I'm also making sure not inside states for LYRICS_EDIT, HARMONY_FIGBASS_EDIT, and TEXT_EDIT, where it might make sense for user to apply a symbol from a palette by doubleclicking.
Fixed in branch master, commit a0bdb5f217
Merge pull request #4524 from ericfont/280830-double-click-palette-exit-edit-mode
fix #280830 exit edit mode if double-click palette
To be clear though: the crash it. happens because you are double-clicking the time signature in the score - you aren't supposed to do that. If you just single click, it works as expected already.
Automatically closed -- issue fixed for 2 weeks with no activity.