musescore / musescore/MuseScore

Context menus are offset when opened close to the right edge of the screen

Open
#33,930 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

community good second issue P4 UI
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

UI bug (incorrect info or interface appearance)

Description with steps to reproduce

When right-clicking to bring up a context menu, the menu should open with its top left corner at the mouse position. This works in most cases but beyond a certain threshold (close to the right edge of the screen) the menu will "snap" to the right edge of the screen.

This also affects the "page view" menu, which is also snapping to the right edge of the screen.

Task

If there is not room for the context menu to appear to the right of cursor's position, it should appear to the left instead, like this:

Image

The context menu may still spill out over the right edge the MSS window if there is enough space on the screen for it to appear:

Image
Supporting files, videos and screenshots

https://github.com/user-attachments/assets/03f1d0b3-75d0-461e-9e86-c856d5443d78

In which versions of MuseScore Studio is this issue present?

latest nightly

Regression

No.

Operating system

Tested on macOS, but likely present on other systems

Additional context

Discovered while working on #33867 - the culprit is (at least partially) the movePos call that takes place inside the conditional that was changed in that PR.

Checklist
  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the movePos call mentioned in the issue and the change from #33867, then reproduce the context-menu and page-view menu near the right screen edge. Done means the menu opens to the left when there is not enough room on the right, while still allowing it to extend beyond the MSS window when screen space permits.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.