Right-click on an object does not highlight the object before showing the context menu

• Jan 30, 2020 - 18:36
Reported version
P2 - Medium
S4 - Minor

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit):, revision: 20414b2

Right-click on a measure that is not currently selected. Everything from "Paste" to "Remove selected measures" is not available when you click on it. You have to select one or more measures first.

Solution: More options need to be greyed out when the user right-clicks on a measure without first selecting anything.


Workaround No Yes

Would the workaround be to left-click select or range select the element on which you right-click?

The solution (IMHO) would not be to (primarily) to grey out what is not applicable, but to
a) have the cursor (selection) follow the right-click, like it does in all common apps, from Notepad and up and the context menu entries be applicable.
b) unless the cursor is already under the selected area, which could be a range selection done via a previous step. (e.g. if you have two bars selected with ctrl and left-click, the right-click should not reset it to selecting a single bar/note/rest)

That's exactly what my fix does. As you point out, the selection should always automatically follow the element(s) that are being right-clicked so that the correct context menu pops up. I have it mostly working at this point. The difficulty is in handling and testing all of the edge cases, especially when it comes to multiple selection using the Shift and Ctrl keys.

Note that once this fix is in place, graying out any logically unavailable items in the context menu (as well as in the Edit menu) is a separate issue that should be fixed separately.

Title Right-click on a measure opens menu, but options do not work. Right-click on an object does not highlight the object before showing the context menu

@Marc Sabatella you mentioned on Telegram that it worked for you on v2.x (which would make this a regression)? I am trying it on v2.3.2 on macOS, and for me it has the same behaviour as what we are seeing on v3.4.2

I don't specifically remember saying that, but I don't deny it either :-). I don't have my machine with 2.3.2 installed with me right now. Could be I was mistaken, could be you misunderstood me, or it could be there is some particular case that did work but others never did. If you have the permalink to my comment, let me know and maybe I can figure out what I meant.