Page Settings, Apply to All Parts glitches

• Mar 10, 2019 - 19:14
Reported version
3.0
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
PR created
Regression
No
Workaround
No
Project

1) Open the attached score (don't worry about how weird it looks, it's for animating a drum machine).
2) File menu, Parts... New All, then OK. That will generate tabs for the score and 11 parts.
3) Format menu, Page Settings..., change portrait to landscape (any change will do)
4) Click the Apply to All Parts button.
5) In Ubuntu, on my i5 desktop, the dialog disappears behind the main MuseScore application window for several seconds, and the OS flashes a "MuseScore is not responding, do you want to force quite or wait?" message, then the dialog reappears and all is normal.
In Windows 10, on the same desktop machine, the MuseScore taskbar icon blinks a few times, and the dialog is frozen while it processes. Not nearly as bad as Ubuntu.

The button works, but it can scare a user, and on Ubuntu might even cause the user to force quit the MuseScore app. The attached score is not that big. 11 staves is not that many. This is probably worse with bigger scores.

Attachment Size
BIYH_Grid302.mscz 39.01 KB

Comments

This code sets the styles/properties of each part's score, then does a new layout of the score. Somewhere in there it seems to be setting the focus to the application window, away from the dialog box. Then the dialog box gets the focus back when it's done.

The problem is caused by these two lines of code inside ScoreAccessibility::updateAccessibilityInfo()
mscore->activateWindow();
w->setFocus();

This is called for each part by MScore::endCmd().
Why must this happen in ScoreAccessibility? Is there a way around it when a dialog is open maybe, to alleviate this issue?

Git Blame says that this code is 4 and 5 years old:
https://github.com/musescore/MuseScore/blame/master/mscore/musescore.cp…
https://github.com/musescore/MuseScore/blame/master/mscore/scoreaccessi…

Status active PR created

This is greatly alleviated in this PR, which should be merged this Wednesday: https://github.com/musescore/MuseScore/pull/4456
On Ubuntu, the dialog disappears for a blip, less than a second. There are no "not responding" messages.
On Windows there is only one blink of the app icon in the taskbar.
I don't know if this is fixed, but I think that it is. The remaining problem is the code in ScoreAccessibility. That first command, activateWindow(), was added to "Fix palette taking keyboard focus." - might there be a better way to do that 4 years later?
IMO that is a separate issue to be created, if necessary.