Regression: use of navigator affects all open scores
Score with more than one page, parts with 1 page, Navigator enabled
Switch to part: you're on page 1 (the only page)
Switch to score, navigate to some page other than the 1st, using the navigator
Switch back to part: now the Navigator is out of scope in 2.1 (3c7a69d), but not in 2.0.3
Comments
Related to #137446: Navigator rectangle selection is lost, maybe?
Indeed.
I don't believe it is the commit fixing #137446: Navigator rectangle selection is lost though (for 2.1 this would be cc6078495c), because without that the blue rectangle doesn't show at all. But any of the commits leading to that other issue might be the cause. Or that fix was just not sufficient.
"because without that the blue rectangle doesn't show at all."
True, and so, impossible to check further/elsewhere here.
master does not have this issue, regardless having the same change from #137446: Navigator rectangle selection is lost, (in 4ff8227a14)
I believe the problem is due to this:
https://github.com/musescore/MuseScore/commit/80ee93e2358fd2bf3f6e501d2…
The effect of this that when switching tabs, Navigator::_cv gets cleared, so then we we eventually get to Navigator::setScoreView(), we don't disconnect the signals from the previous tab. Meaning that even after leaving the part tab and returning to the score, the part continues to receive signals when you access the Navigator. Note the bug only affects parts you have actually visited; parts you haven't viewed won't have ever connected signals.
Commenting out the call to navigator()->setScore() that the above commit added fixes the problem, but presumably the bug that was fixing gets unfixed - except I can't reproduce that problem even with that line commented out. I guess maybe also switching the order of the calls to setScore(0 and setCurrentScoreView(), but I don't know if that really makes sense (EDIT: nope, this breaks the Navigator completely). I'm not really comfortable with this aspect of the code, but hopefully the investigation helps.
So that was to fix #112911: Score does not display fully in Navigator if latter set to ON when score loads]
Changing the order of these 2 is what fixed #137446: Navigator rectangle selection is lost.
Then maybe disconnecting signals within Navigastor::setScore(), or just eliminating the line that clears _cv?
BTW, this doesn't just affect parts - all scores you have open are affected. Switch tabs, move the Navigator, return to the previous tab, and you'll see you've moved the score view there as well.
I don't understand the reasoning behind calling navigator->setScore(cs) from within MuseScore::setCurrentScoreView(view) in the first place. It seems navigator->setCurrentView(view) already sets the current score if there is one. If I comment out the call to setScore(), I still can't reproduce the issue that was supposedly fixing, but maybe something else changed that makes this unnecessary?
Anyhow, for me either of the following works:
- remove the call to setScore()
or
- remove the line clearing _cv from setScore()
Either seems to work with no ill effects that I can see. But obviously there have been issues in this area and there are subtle interactions I probably don't understand. Some special sequence of operations in which the setScore(0 ends up being necessary, or in which clearing _cv is necessary.
As opposed to what I said in #6 , master is affected by this too.
As mentioned in #112911: Score does not display fully in Navigator if latter set to ON when score loads, #3 , that problem indeed is/was not always reproducible.
And indeed deleting that `_cv = 0;` from Navigator::setScore() seems to fix it (for master at least)
Title changed to reflect actual situation.
The original order of calls to setScoreView() and setScore() makes more sense, I think, so my PR restores that. That in itself fixes the issue at hand. Commenting out the line that clears _cv fixes the problem with the blue rectangle not showing. I could have removed that line but left the order of calls the same, but I do think the original order made more sense and was more consistent with elsewhere in the code.
https://github.com/musescore/MuseScore/pull/3155
Fixed in branch 2.1, commit 1bf2fc8151
fix #185876: mavigator affects all open scores
Fixed in branch 2.1, commit 963873b19f
Merge pull request #3155 from MarcSabatella/185876-navigate-all
fix #185876: mavigator affects all open scores
Automatically closed -- issue fixed for 2 weeks with no activity.