musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.89k stars 2.57k forks source link

Crash when interacting with time signature properties after selecting via keyboard #22085

Open mattblo opened 3 months ago

mattblo commented 3 months ago

Issue type

Crash

Steps to reproduce

  1. Open a score
  2. Press the "right" key on the keyboard
  3. Press "Alt" + "Left" to select the Time Siganture
  4. In the Properties Panel click on "time signature properties"
  5. See no beaming options
  6. Click in the empty space in the 'Beam groups' box
  7. Crash

The crash should be fixed, and the beaming preview windows should appear.

MuseScore Version

OS: macOS 14.1, Arch.: x86_64, MuseScore version (64-bit): 4.2.1-240230937, revision: github-musescore-musescore-d757433


Original issue

Issue type

UI bug (incorrect info or interface appearance)

Bug description

If you select the time signature using the keyboard and open "Time signature properties...", no beaming options are displayed. The interface even freezes when you click on OK.

image

Steps to reproduce

  1. Open a score
  2. Press the "right" key on the keyboard
  3. Press "Alt" + "Left" to select the Time Siganture
  4. In the Properties Panel click on "time signature properties"
  5. See no beaming options

Screenshots/Screen recordings

No response

MuseScore Version

OS: Windows 10 Version 2009 or later, Arch.: x86_64, MuseScore version (64-bit): 4.2.1-240230937, revision: github-musescore-musescore-d757433

Regression

I don't know

Operating system

Windows 11

Additional context

If you have a Keyboard Shortcut for "time siganture properties" this also does not work. If you click the time signature with the mouse all things are right.

mattblo commented 3 months ago

Perhaps this is due more to accessibility than to the UI

cbjeukendrup commented 3 months ago

This has indeed to do with how the time signature was selected. The dialog tries to retrieve the time signature using interaction->hitElementContext().element, but hitElementContext() only contains information if you click the time signature, and not when you select it using any other way (i.e. using the keyboard). I guess the solution would be to retrieve the time signature from the selection instead of from the hitElementContext().

MarcSabatella commented 3 months ago

I can guess why this was done - because after you click a time signature, the whole column of time signatures is selected (across all staves), but the dialog is meant to only operate on one at a time.

I don’t know that anyone particularly likes the fact that these properties are per staff, so if the code easily supports working on multiple staves at once, that’s kind of a plus. But we’d have to deal with the possibility of the selected time signatures not actually all being the same. So it could get a bit complicated.

The simpler solution to the original problem here would be to use the clicked element if available, and the selection if not.

avvvvve commented 3 months ago

You can actually crash MuseScore if you try and click in the empty space where the beam group preview windows should be, so I renamed this issue and added some additional context to the top.

We are working on a redesign of time signatures properties now, so if we want to fix this crash for now, I'd recommend making the selection of an individual time signature in this way act as if you've selected the entire time signature across all instruments once the properties window is opened.

avvvvve commented 3 months ago

@bkunda please adjust my triaging if needed!