Skip to content

fix(autoscroll): preserve native middle-click in window title bars - #1317

Merged
lujjjh merged 2 commits into
mainfrom
fix/titlebar-autoscroll-bypass
Jul 28, 2026
Merged

lujjjh merged 2 commits into
mainfrom
fix/titlebar-autoscroll-bypass

Conversation

@lujjjh

@lujjjh lujjjh commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Middle clicks in title bars and tab strips should remain available to the target application instead of activating autoscroll.

This change:

  • infers standard macOS title-bar bounds from the accessibility geometry of native window controls
  • bypasses autoscroll activation only within that title-bar region, preserving native middle-click behavior in apps such as Zotero, Chrome, and Firefox
  • retains the existing Chromium-specific fallbacks for Chromium accessibility hit-test holes
  • stops querying window controls after the first valid frame is found

The title-bar detection is intentionally generic and does not rely on application bundle identifiers or per-app rules. It is deliberately limited to one inferred title-bar height; applications that do not expose their tab strips through accessibility are not given a broader fallback region.

Testing

  • Added coverage based on observed title-bar geometry in Zotero, Chrome, and Firefox
  • Verified points below the title bar are not bypassed, including when accessibility hit testing returns only the window
  • Verified malformed or missing window-control geometry does not trigger the rule
  • All 325 unit tests pass
  • SwiftFormat and SwiftLint pass

Fixes #1315

@lujjjh lujjjh added the bug Something isn't working label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Middle click does not close tabs in Zotero with "Enable autoscroll" turned on

1 participant