Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbar buttons do not react to long clicks #26665

Open
4 tasks done
krasko78 opened this issue Feb 21, 2025 · 1 comment · May be fixed by #26679
Open
4 tasks done

Toolbar buttons do not react to long clicks #26665

krasko78 opened this issue Feb 21, 2025 · 1 comment · May be fixed by #26679
Assignees
Labels
regression nightly Works correctly in the latest released version and is broken in the nightly builds UX/interaction

Comments

@krasko78
Copy link
Contributor

krasko78 commented Feb 21, 2025

Issue type

UX/Interaction bug (incorrect behaviour)

Description with steps to reproduce

Originally I reported the issue for the Undo/Redo buttons with the following steps:

  1. Open any score or create a new one.
  2. Perform an action that will enable the Undo command on the menu and the Undo button.
  3. Click the Undo button. Nothing happens for a few clicks (3-10) and then it undoes.
  4. Same for the Redo button and when adding more actions to the undo/redo list.
    The keyboard shortcuts CTRL+Z / CTRL + Y seem to work fine though.

My investigation showed that:

  1. The problem happens when the Undo/Redo buttons are held down longer (long click). This does not happen in 4.4.4.
  2. The Note input toolbar buttons are also affected.
  3. Interestingly, in 4.4.4 the Undo/Redo buttons work as expected, but the Note input toolbar buttons exhibit this issue.
  4. This is the same issue as #16012 and the fix done there appears not to have fixed it. Handling the pressAndHold signal, even directly as implemented in the fix, supresses the click signal.
  5. I was not able to find out why the Undo/Redo buttons do work in 4.4.4. A quick look at the code didn't reveal any recent changes but I do not have the time to dig into that (I was of course curious).
  6. Luckily I found a new fix and am opening a PR with it: when handling the pressAndHold signal, if we do not consume it, we should set the accepted property of the mouse event to false. In this case the click event is not supressed. Interestingly, for pressAndHold the accepted property is true by default which means the event has to be unaccepted if not consumed. In addition, what the Qt documentation says is true: a click will happen even if you move the mouse between the press and release (as much as you want wherever you want) as long as the release occurs inside the control. It had appeared to not work properly in UI is hard to use when the user is moving the mouse while clicking #16012 because pressAndHold would suppress the click.

Supporting files, videos and screenshots

undo-redo.mp4

What is the latest version of MuseScore Studio where this issue is present?

Latest master

Regression

Yes, this works in the latest released version and is broken in the nightly builds

Operating system

Windows 10

Additional context

No response

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
@muse-bot muse-bot added regression nightly Works correctly in the latest released version and is broken in the nightly builds UX/interaction labels Feb 21, 2025
@krasko78
Copy link
Contributor Author

Can be assigned to me. I have a whole lot of additional info to share after digging into it.

@krasko78 krasko78 changed the title Undo/Redo buttons work only when in a good mood Toolbar buttons do not react to long clicks Feb 22, 2025
@krasko78 krasko78 linked a pull request Feb 22, 2025 that will close this issue
8 tasks
@cbjeukendrup cbjeukendrup moved this to In Progress in MuseScore Studio 4.5 Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression nightly Works correctly in the latest released version and is broken in the nightly builds UX/interaction
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants