Skip to content

About

A macOS menu bar app that dims chosen windows with click-through overlays that follow each window as it moves, minimizes, or changes Spaces.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Window Overlay

A macOS menu bar app that dims individual windows with a translucent, click-through overlay.

Features

  • Menu bar app: a SwiftUI popover lists your open windows; no Dock icon.
  • Per-window dimming: add an overlay to any window and set its darkness from 10% to 90%.
  • Click-through: overlays never intercept clicks, scrolling, or typing.
  • Stays in place: overlays follow their window as it moves or resizes, at display refresh rate.
  • Correct stacking: an overlay sits directly above its window, so windows in front of it, menus, and the Dock are never dimmed.
  • Smart visibility: overlays hide while their window is minimized, its app is hidden, or it's on another Space, and come back with it. Full-screen windows are supported.
  • Matching corners: overlays follow the window's corner radius, including the larger radii introduced in macOS 26.
  • Persistence: overlays are saved and re-applied when their window reopens, for example after you relaunch the app or restart your Mac.
  • Global switch: pause or resume all overlays at once; the menu bar icon dims while they're paused.

Requirements

  • macOS 14 Sonoma or later (tested on macOS 27)
  • Xcode 26 or later to build
  • Accessibility permission (requested on first launch)

Building

Open WindowOverlay.xcodeproj in Xcode and press ⌘R, or build from the command line:

./build.sh          # Release build in ./build
./build.sh debug    # Debug build
./build.sh test     # run the unit tests
open build/Build/Products/Release/WindowOverlay.app

Accessibility Permission

Window Overlay uses the Accessibility API to list windows and to be notified when they move, resize, or close. On first launch macOS asks for permission:

  1. Click Open System Settings in the prompt (or in the app's popover).
  2. Turn on Window Overlay under Privacy & Security › Accessibility.
  3. The app notices the change automatically; there's no need to relaunch.

Rebuilt the app and it asks again? ./build.sh signs with an Apple Development certificate from your keychain when there is one; macOS then recognizes every rebuild as the same app and keeps the permission. Without such a certificate, builds are signed ad hoc, which macOS treats as a new app each time: the old entry no longer applies even though its switch still shows as on. In that case select Window Overlay in the Accessibility list, remove it with −, and add the new build again, or run tccutil reset Accessibility com.example.WindowOverlay and relaunch.

Usage

  • Add an overlay: open the menu bar popover and click Add Overlay next to a window.
  • Adjust darkness: drag the Opacity slider of an active overlay.
  • Show/hide one overlay: click its eye icon.
  • Pause all overlays: use the switch at the top of the popover.
  • Remove an overlay: click Remove. Closing the window removes its overlay too.

Overlays whose window isn't open, for example because its app isn't running, are listed as "Not open" and come back automatically when the window reappears. They're matched by app and window title.

How It Works

  • The window server provides each target's live frame and visibility. This needs no permission, stays accurate during drags, and never blocks on a frozen app.
  • A single timer serves all overlays. It runs at 2 Hz when nothing happens and at display rate while something moves (mouse button down, Accessibility move/resize notifications, app activation, Space changes).
  • Overlays are normal-level, borderless, click-through windows ordered directly above their target, re-stacked when a click or activation raises the target.
  • Windows are only listed while the popover is open.

See docs/ARCHITECTURE.md for details.

Project Structure

WindowOverlay/
├── WindowOverlayApp.swift          # App entry point and app delegate
├── WindowOverlay.entitlements      # Not sandboxed (Accessibility needs it)
├── AppIcon.icon/                   # App icon (Icon Composer document, Liquid Glass)
├── Models/
│   ├── OverlayConfig.swift         # Opacity and on/off state of one overlay
│   ├── WindowIdentifier.swift      # Saved window identity; live window info
│   ├── OverlayGeometry.swift       # Coordinate conversion, corner radii
│   └── OverlayMatcher.swift        # Matches saved overlays to open windows
├── Managers/
│   ├── WindowManager.swift         # Window listing (Accessibility) and live state (window server)
│   ├── OverlayManager.swift        # Tracking engine: overlay windows, polling, stacking
│   ├── AccessibilityObserver.swift # AXObserver wrapper
│   ├── PermissionManager.swift     # Accessibility permission
│   └── PersistenceManager.swift    # UserDefaults storage and migration
├── State/
│   └── OverlayState.swift          # Observable source of truth for the UI
├── UI/
│   ├── MenuBarController.swift     # Status item and popover
│   ├── MenuBarView.swift           # Popover content
│   └── WindowRowView.swift         # Window and overlay rows
└── Windows/
    ├── OverlayWindow.swift         # Click-through overlay window
    └── OverlayView.swift           # Layer-backed dimming view
WindowOverlayTests/                 # Unit tests (Swift Testing)

Troubleshooting

  • No windows listed: check the Accessibility permission (see above), then click Refresh.
  • An overlay didn't come back after relaunch: it's matched by app and exact window title. If the title changed while the app wasn't running, remove the entry and add the window again.
  • Logs: log stream --predicate 'subsystem == "WindowOverlay"'

License

This project is provided as-is for educational purposes.

Contributing

Feel free to submit issues, fork the repository, and create pull requests for any improvements.

About

A macOS menu bar app that dims chosen windows with click-through overlays that follow each window as it moves, minimizes, or changes Spaces.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages