[Bug/Feature]: Enable area selection overlay to cover the macOS Menubar
Hi @richiemcilroy,
Currently, when triggering the Area Screenshot tool, the top macOS Menubar gets grayed out and is excluded from the selectable area bounds.
Problem: When reporting software bugs or giving product feedback, I frequently need to capture open application menus, system clock timestamps, or status items located directly inside the Menubar.
Proposed Solution: Please allow the selection crosshair and overlay to cover 100% of the screen geometry, including the native macOS Menubar area, without dimming it out.
Looking at the codebase, this involves how the target selection overlay window is positioned on macOS.
The overlay window bounds are set in apps/desktop/src-tauri/src/windows.rs at lines 1556-1564:
let position = display.raw_handle().logical_position();
let size = display.logical_size().unwrap();
window_builder = window_builder
.inner_size(size.width(), size.height())
.position(position.x(), position.y());
These values come from CGDisplayBounds in crates/scap-targets/src/platform/macos.rs (lines 53-68), which returns the display's bounds in points. However, macOS has a concept of "visible frame" vs "frame" - the visible frame excludes the menubar area, while the full frame includes it.
The fix would involve using the full display frame instead of the visible frame when setting up the overlay window. On macOS, this typically means using NSScreen.frame rather than relying solely on CGDisplayBounds, or explicitly positioning the window to start at y=0 (top of screen) with a height that includes the menubar.
Key files to modify:
crates/scap-targets/src/platform/macos.rs- potentially add a method that returns the full screen frame including menubarapps/desktop/src-tauri/src/windows.rs- updateShowCapWindow::TargetSelectOverlayto use full screen bounds
One consideration: the overlay needs to handle the fact that the menubar can be on different edges depending on screen arrangement, and the primary display's menubar height may differ from other displays.
Thanks for the suggestion! The area overlay still sits below the menu bar, so we'll look at letting it cover the full screen.
I looked into why this happens. The area overlay window already spans the whole display, menu bar included, but it sits at window level 7. target_overlay_level() in apps/desktop-gpui/src/platform.rs is recording_controls_level() - 1, and the recording controls sit at 8 (kCGModalPanelWindowLevel). The menu bar sits at 24 and its status icons at 25, so in that strip the menu bar is on top and gets the click.
So to cover that area, the overlay needs a level above 25. The catch is that two other windows hang off the same number. The camera bubble sits at the controls' level so it stays above the overlay, and the Focus ring sits one below the overlay. If we just raise the base, the controls, the camera and the Focus ring all end up above the menu bar for the whole recording.
My suggestion is to give the overlay its own level above the status icons, raise the camera bubble above it while the overlay is up, and leave the recording controls and the Focus ring where they are. Once the overlay closes, the camera bubble drops back to 8. The Focus ring would just need its own level instead of target_overlay_level() - 1.
I tried this on a branch and it works. In Area mode, a drag that starts on the menu bar now draws the selection. While the picker is up, the overlay sits at 26 and the camera bubble at 27. The bubble drops back to 8 once the overlay closes, and the Focus ring keeps the level it had before (6).
One thing came up while testing. Once the overlay covers the menu bar, a drag that starts in that strip moved the whole overlay window instead of drawing a selection, because AppKit treats the top strip of the overlay as a titlebar. Setting app_owns_titlebar_drag: true in the overlay's WindowOptions fixes that.
Does that match what you had in mind? @richiemcilroy Happy to open a PR.