Skip to content

fix: drag and click widgets on every display while editing the bar in place - #348

Merged
Seb-GRAF merged 2 commits into
mainfrom
fix/345-edit-bar-main-display
Oct 28, 2026
Merged

Seb-GRAF merged 2 commits into
mainfrom
fix/345-edit-bar-main-display

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

While editing the bar in place, widgets on the main display took no clicks or drags: a press in the middle of a tile went to the app behind the bar, and only the tile's edges responded. Dropping a widget also made the bar jump: the dragged image grew on landing, and the tiles overshot and sprang back once the move was saved.

Fixes #345

Changes

  • Clicks and drags. The edit tiles drew the widget with hit testing turned off. On the transparent bar window, that left holes where the window server sent clicks to the app behind it. The widget now keeps hit testing; the drag source still takes every press, and widget actions stay off while editing. The drag source also accepts the first click, so a bar that isn't key, as on another display, starts a drag on the first press.
  • Landing. The drop hands AppKit the landing frame together with the unscaled drag image, so the image slides into the slot at the tile's size instead of 5% larger.
  • After the drop. The moved tile stays hidden while the image slides in. The save waits until the bar has drawn, and the insertion marker clears after the save with animations off. Before, each section redrew once with the old order and animated toward it, so moved tiles overshot their new place and sprang back.

Testing

  • swift test --filter "WidgetDragSessionTests|BarEditViewTests|BarEditingTests|BarViewTests|BarPreview|PopupClick|Presentation" passes.
  • New tests: a non-key bar panel passes its first click to the tile, and tiles keep the place the drop left them while a section catches up with the saved order (before the fix they land at −11, 57 and 349 instead of 37, 105 and 193).
  • On the live bar with an external display, tiles now drag and select from anywhere on them.
  • Drop frames were captured from a test build: the image lands at the tile's size, and the tiles no longer move after landing.
  • Not fixed here: saving a move still blocks the main thread for 0.2 to 0.4 s with a large configuration, because WidgetSetup.move loads it three times. Nothing moves during that time, but animated widgets pause.
  • Behavior change: on a second display's bar, a moved widget appears in its new place without the spring, and a failed move snaps back.

Merging

Merge commit: the click fix and the drop animation are separate commits.

Claude Opus 5.5 via Claude Code

@Seb-GRAF
Seb-GRAF enabled auto-merge October 28, 2026 07:11
@Seb-GRAF
Seb-GRAF merged commit 2df97ea into main Oct 28, 2026
7 checks passed
@Seb-GRAF
Seb-GRAF deleted the fix/345-edit-bar-main-display branch October 28, 2026 07:15
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widgets on the main display take no clicks or drags while editing the bar in place

1 participant