Skip to content

feat: keep windows clear of StableBar without a tiling window manager - #48

Merged
Seb-GRAF merged 2 commits into
mainfrom
feat/47-window-clearance
Oct 16, 2026
Merged

Seb-GRAF merged 2 commits into
mainfrom
feat/47-window-clearance

Conversation

@Seb-GRAF

@Seb-GRAF Seb-GRAF commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Fixes #47. Ordinary and maximized windows can cover StableBar when users do not run a tiling window manager. macOS does not provide a public screen-space reservation API for a custom bar.

Changes

Adds Customize → Appearance → Windows → Keep windows clear of StableBar, disabled by default (bar.keepWindowsClear). Enabling it offers Accessibility access; the settings show whether access is granted. Configuration files, profiles, includes, package layers and command-line bar edits use the existing composition and editing paths.

With access, StableBar observes application and window changes, moves overlapping standard windows below each display's bar, and shrinks them when necessary to fit above the Dock. It uses the rendered bar's offset and scaled height, waits for mouse-button release, and remembers attempted frames to avoid repeated attempts. It waits for window notifications to settle and handles resizing before repositioning, so title-bar double-click zoom completes below the bar. Native fullscreen windows, minimized windows, dialogs and hidden applications are skipped. Observers stop when disabled, when access is revoked, during sleep and on exit. Disabling does not restore earlier window positions.

Updates the README, setup guidance, schema and a minimal example. AeroSpace/yabai users should leave this off when those tools already manage their gaps. Apps that do not expose the needed Accessibility operations, or have a minimum size that cannot fit, remain a limitation.

Testing

  • swift test: all 130 tests pass. New geometry cases cover movement versus shrinking, repeat-call stability, Dock/menu-bar clearance, horizontal and vertical monitor arrangements, display selection for spanning windows, differing bar sizes and bars outside usable space.
  • Schema/decoder parity and the existing profile, composition and edit tests pass.
  • ./scripts/build.sh, codesign --verify --deep --strict dist/StableBar.app, example configuration validation and git diff --check pass.
  • Live validation: used a separately identified app and scratch configuration. Verified the setting off/on, missing/granted Accessibility status, and an ordinary floating AppKit window moving from y = 0 to y = 40. Reproduced the title-bar double-click bug (window shrank but stayed at y = 0), fixed the resize/move sequence, and repeated the gesture: the window settled at y = 40, height 1400 on a 3440 × 1440 display. The user also confirmed the updated behavior works.
  • The test Mac runs AeroSpace; the test window was explicitly floating. No AeroSpace configuration was changed. Physical multi-display changes, sleep/wake, minimum-size refusal, native fullscreen transitions and a broad real-app matrix were not independently completed. The user accepted the live behavior and requested finalization.
  • Settings screenshots (off, access required, access granted) were captured locally. They are not attached because the GitHub browser preview is signed out; GitHub CLI authentication does not provide image attachment upload. No screenshots or scratch files are committed.

Merging

Contains a feat: commit and a fix: follow-up for title-bar zoom. Squash with the PR’s feat: title to keep one changelog entry. Do not merge until reviewed.

GPT-6-astra via Codex in T3 Code.

@Seb-GRAF
Seb-GRAF marked this pull request as ready for review October 16, 2026 14:49
@Seb-GRAF
Seb-GRAF merged commit 716273f into main Oct 16, 2026
4 checks passed
@Seb-GRAF
Seb-GRAF deleted the feat/47-window-clearance branch October 16, 2026 14:52
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.5.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.

Keep windows below StableBar without a tiling window manager

1 participant