Skip to content

Reduce dock separator's oversized hit-margin - #226

Open
tharos-devs wants to merge 2 commits into
musescore:mainfrom
tharos-devs:fix/toolbar-click-lag
Open

Reduce dock separator's oversized hit-margin#226
tharos-devs wants to merge 2 commits into
musescore:mainfrom
tharos-devs:fix/toolbar-click-lag

Conversation

@tharos-devs

Copy link
Copy Markdown

Summary

  • DockSeparator.qml's resize-handle MouseArea extends 5px beyond the separator's own ~1px-thin visual bounds, for easier grabbing when resizing docks.
  • That invisible catch-zone can silently overlap adjacent interactive content in a neighboring dock — e.g. the last few pixels of a toolbar button sitting right above a separator — and wins the Qt Quick hit-test there, swallowing clicks meant for that control before they ever reach its own MouseArea.
  • Shrinking the margin from -5 to -2 keeps the separator comfortably grabbable while greatly reducing the chance of overlapping neighboring controls. Validated manually: the original click-loss is very hard to reproduce anymore, and the resize-grab ergonomics (getting the resize cursor, dragging) feel unchanged from stock 4.7.4.

Fixes musescore/MuseScore#34603

Note on scope / trade-off

This is a minimal, low-risk mitigation (one-line diff), not a structural fix — an even smaller invisible catch-zone still has some residual chance of overlapping content in an unusually tight layout. A more thorough fix would have the separator's hit-region conditionally yield only where it actually overlaps interactive content (rather than shrinking the margin universally), but that requires new runtime hit-testing logic in a widely-shared component. Happy to discuss if maintainers would prefer that direction instead.

Test plan

  • Manually reproduced the original bug pre-fix (click silently ignored near a toolbar button's bottom edge while its tooltip is shown)
  • Manually verified the fix resolves it (click reliably registers in the same spot)
  • Manually verified no regression in separator resize behavior (drag-to-resize, cursor feedback, double-click-to-reset) across multiple dock boundaries (toolbar/score, and the Mixer panel specifically, which was checked against an earlier over-broad attempt that did regress)
  • Automated test coverage — not attempted; this is an interactive mouse/hit-testing behavior not easily covered by existing headless test infrastructure

DockSeparator.qml's resize-handle MouseArea extends 5px beyond the
separator's own ~1px-thin visual bounds for easier grabbing. That
invisible catch-zone can silently overlap adjacent interactive content
(e.g. a toolbar button sitting right above a separator), stealing
clicks meant for it before they ever reach the button's own MouseArea.

Shrinking the margin to 2px keeps the separator comfortably grabbable
while greatly reducing the chance of it overlapping neighboring
controls.

Fixes musescore/MuseScore#34603
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7e711d71-7ed4-4a5b-92cf-c1e604927345

📥 Commits

Reviewing files that changed from the base of the PR and between 644172a and 5c1bd77.

📒 Files selected for processing (1)
  • framework/dockwindow_v2/qml/Muse/Dock/DockSeparator.qml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Dock separator MouseArea anchor margin changes from -5 to -2 in both Dock implementations. No exported or public entities change.

Merge Risk: ⚪ Minimal · up to 5c1bd

The change narrowly reduces the separator's invisible click-capture area while preserving resize behavior, with no actionable merge-blocking risk remaining after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: reducing the dock separator hit margin.
Description check ✅ Passed The description explains the bug, cause, fix, scope, linked issue, and manual test results; the omitted repository checklist is non-critical.
Linked Issues check ✅ Passed Both DockSeparator.qml changes reduce the hit margin from -5 to -2 and address issue #34603 by reducing click interception.
Out of Scope Changes check ✅ Passed The one-line changes in both DockSeparator.qml files directly support the linked issue and contain no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@avvvvve
avvvvve requested review from Eism and igorkorsukov and removed request for igorkorsukov August 18, 2026 14:23
@avvvvve avvvvve moved this from Available to Tentatively in progress in Community Projects Aug 18, 2026
@avvvvve avvvvve moved this from Tentatively in progress to In progress in Community Projects Aug 18, 2026
MouseArea {
anchors.fill: parent
anchors.margins: -5 //! NOTE: extra space for user convenience
anchors.margins: -2 //! NOTE: extra space for user convenience

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please fix it in dockwindow_v2 too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, done — applied the same -5-2 margin fix to dockwindow_v2/qml/Muse/Dock/DockSeparator.qml in 5c1bd77c6.

Same rationale as dockwindow: -5px oversized MouseArea margin can
silently steal clicks from overlapping neighboring content.

Addresses review comment on PR musescore#226.
@Eism

Eism commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

/build

@github-actions

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toolbar buttons sometimes silently ignore clicks

3 participants