Skip to content

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

Description

@mathesoncalum

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

ctxmenus.mov

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Priority: TrivialUIVisual issues affecting the UI (not notation)communityIssues particularly suitable for community contributors to work ongood second issueExpected to be doable for contributors with a little bit of experience with our codebase

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions