Skip to content

Split trigger-zone into separate untrigger-zone for click restore#6

Open
klockeph wants to merge 1 commit into
malpern:mainfrom
klockeph:pk/fix-untrigger
Open

Split trigger-zone into separate untrigger-zone for click restore#6
klockeph wants to merge 1 commit into
malpern:mainfrom
klockeph:pk/fix-untrigger

Conversation

@klockeph

Copy link
Copy Markdown

This PR fixes a pet-peeve I encountered when starting to use sketchybar-toggle: When I click something in the menu bar (and realistically that is why I open it in the first place to get to the Edit, Preferences, etc. menus), the sketchybar immediately comes up and causes the ugly double-rendering of both bars on top of each other.


triggerZone was serving double duty: hiding the bar when the cursor entered the top N px, and also as the guard that prevented a click from restoring the bar. These two roles have conflicting ideal values.

  • Hiding needs a small zone (~10px) so the bar only hides when you're genuinely approaching the menu bar edge.
  • Click restore needs a larger zone (~30px, the macOS menu bar height) so that clicking File/Edit/… while the bar is hidden doesn't snap it back mid-navigation.

Using a single value forced a bad tradeoff: 10px meant menu clicks restored the bar; 30px meant the bar hid on any casual hover near the top.

Adds untriggerZone (default 30px): a click while hidden only restores the bar if the cursor is at or below this threshold. triggerZone continues to control hiding exclusively. Both are independently configurable via --trigger-zone and --untrigger-zone.

triggerZone was serving double duty: hiding the bar when the cursor
entered the top N px, and also as the guard that prevented a click from
restoring the bar. These two roles have conflicting ideal values.

- Hiding needs a small zone (~10px) so the bar only hides when you're
  genuinely approaching the menu bar edge.
- Click restore needs a larger zone (~30px, the macOS menu bar height)
  so that clicking File/Edit/… while the bar is hidden doesn't snap it
  back mid-navigation.

Using a single value forced a bad tradeoff: 10px meant menu clicks
restored the bar; 30px meant the bar hid on any casual hover near the top.

Adds untriggerZone (default 30px): a click while hidden only restores
the bar if the cursor is at or below this threshold. triggerZone
continues to control hiding exclusively. Both are independently
configurable via --trigger-zone and --untrigger-zone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant