notch_width reserves a gap on built-in displays without a notch
What happens
For horizontal bars, bar_calculate_bounds_top_bottom and bar_get_frame in src/bar.c
apply notch_width, notch_offset and notch_display_height whenever
CGDisplayIsBuiltin is true:
bool is_builtin = CGDisplayIsBuiltin(bar->did);
uint32_t notch_width = is_builtin ? g_bar_manager.notch_width : 0;That call is true for every internal display, including the ones without a notch, such
as the MacBook Air M1, the 13-inch MacBook Pro M1 and the 24-inch iMac. On those machines
the bar reserves a gap in the middle of the screen where nothing needs avoiding, and it
also applies notch_offset and notch_display_height. The default notch_width is 200,
so any config with items at the q and e positions gets the gap out of the box.
What I measured
MacBook Pro 13-inch M1 (MacBookPro17,1), macOS 26.7 (25G229), current master
(5f358ec), bar limited to the built-in display. The display has no notch:
did=1 builtin=true frame=(0.0, 0.0, 1440.0, 900.0) safeAreaTop=0.0Two items at q and e. The separation is the distance between their window x
positions:
notch_width=0 items x=[685, 720] separation=35
notch_width=200 items x=[585, 820] separation=235
notch_width=400 items x=[485, 920] separation=435
notch_offset=30 bar Y=30
notch_display_height=50 bar height 50A related case
The gap also appears when the bar sits at the bottom of the screen, where no display has
a notch. On a notched 16-inch M1 Pro (MacBookPro18,1) with macOS 27.0:
position=top notch_width=400 separation=476
position=bottom notch_width=400 separation=476I am less sure this one is a bug, because some configs may use notch_width as a plain
center gap. I mention it so you can decide.
Suggestion
Gate the three properties on a non-zero workspace_display_notch_height instead. It
returns NSScreen.safeAreaInsets.top for a built-in display, which is 0 without a notch.
I opened #859 with this change.
Source: FelixKratz/SketchyBar