Skip to content

Commit aa98568

Browse files
committed
Refine the menu bar visibility comments
1 parent 9f779b4 commit aa98568

3 files changed

Lines changed: 20 additions & 22 deletions

File tree

‎Candela/AppKitIslands/IslandHUDRenderer.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import QuartzCore
44

55
/// The three Island styles. The notch is the island where the display has one;
66
/// where it does not, nothing pretends to be one: the drop grows straight down
7-
/// from the top edge and the edge trace runs straight. The value is a luminous
7+
/// from the top edge and the edge trace runs straight. A visible menu bar lowers
8+
/// the Island to the bar's bottom edge in the notchless form. The value is a luminous
89
/// trace and the information sits where there is screen; nothing is drawn on
910
/// the glass.
1011
///

‎Candela/AppKitIslands/MenuBarVisibility.swift‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
import AppKit
22
import CoreGraphics
33

4-
/// Whether a display's menu bar is on screen right now, and how tall it is.
4+
/// Whether a display's menu bar is on screen, and its height.
55
///
6-
/// Neither `NSScreen` answer works [MEASURED 2026-10-02]. `frame.maxY -
7-
/// visibleFrame.maxY` reads 38 on the notched built-in with the bar auto-hidden
8-
/// (the notch's safe area) and 39 with it shown, and 0 on an external either
9-
/// way. `menuBarAllowance` returns the bar's thickness even while it is hidden.
6+
/// `NSScreen` cannot tell [MEASURED 2026-10-02]. `frame.maxY - visibleFrame.maxY`
7+
/// reads 38 hidden and 39 shown on the notched built-in (the notch's safe area),
8+
/// 0 on an external either way; `menuBarAllowance` reports the bar's thickness
9+
/// even while it is hidden.
1010
///
11-
/// What does change is the window server's own bar window: owner "Window
12-
/// Server", layer 24, origin at the display's top-left, the display's full
13-
/// width and the bar's height (0,0 1800x39 on the built-in, 1800,0 2560x30 on
14-
/// an external). With the bar auto-hidden no Window Server window sits at
15-
/// layer 24 on any display. It is matched on owner, layer and bounds, never on
16-
/// its "Menubar" title: window titles are withheld from a process without
17-
/// Screen Recording, which the app does not ask for, while owner, layer and
18-
/// bounds are reported regardless.
11+
/// The window server's bar window does change: owner "Window Server", layer 24,
12+
/// at the display's top-left, full width, bar height (0,0 1800x39 on the
13+
/// built-in, 1800,0 2560x30 on an external). With the bar auto-hidden no Window
14+
/// Server window sits at layer 24 on any display. Matched on owner, layer and
15+
/// bounds, never the "Menubar" title: titles are withheld without Screen
16+
/// Recording, which the app does not request.
1917
@MainActor
2018
enum MenuBarVisibility {
2119
private static let barLayer = 24
22-
/// Generous for any bar thickness, short of anything that could be a real window.
20+
/// Room for any bar thickness, short of a real window's height.
2321
private static let heightRange: ClosedRange<CGFloat> = 1...60
2422

2523
/// Nil while the bar is hidden, or when the window list cannot say.

‎CandelaKit/Sources/CandelaKit/Support/IslandGeometry.swift‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ public enum IslandGeometry {
3030
/// The notch from the screen's auxiliary areas: the gap between them is the
3131
/// glass. Without them, a drawn notch centred on the FULL frame.
3232
///
33-
/// A visible bar hides anything a window draws in the strip beside the notch,
34-
/// at every level up to the shielding one, so the Island cannot trace the
35-
/// glass then. It hangs from the bar's bottom edge instead, in the notchless
36-
/// form, still centred under the glass where there is one. `menuBarHeight`
37-
/// is nil while the bar is hidden.
33+
/// A visible bar covers the strip beside the notch at every window level up
34+
/// to shielding, so the Island cannot trace the glass. It hangs notchless from
35+
/// the bar's bottom edge instead, still centred under any glass.
36+
/// `menuBarHeight` is nil while the bar is hidden.
3837
public static func notch(
3938
screen: CGRect, menuBarHeight: CGFloat?, auxiliaryTopLeft: CGRect?, auxiliaryTopRight: CGRect?
4039
) -> IslandNotch {
@@ -53,8 +52,8 @@ public enum IslandGeometry {
5352
isReal: false)
5453
}
5554

56-
/// The window: its top on the notch's top (the screen's edge, or the bar's
57-
/// bottom when the bar is showing), as wide as the screen for the edge styles.
55+
/// The window: top on the notch's top (the screen edge, or the bar's bottom
56+
/// while it shows), as wide as the screen for the edge styles.
5857
public static func panelFrame(screen: CGRect, notch: IslandNotch, fullWidth: Bool) -> CGRect {
5958
let height = notch.rect.height + panelExtraHeight
6059
let top = notch.rect.maxY

0 commit comments

Comments
 (0)