restore the grey background behind each overlay title

This commit is contained in:
Andrew Hamilton 2026-08-24 07:43:10 +10:00
parent 62ac013df2
commit 9cd117e12b
2 changed files with 40 additions and 5 deletions

8
kick.c
View file

@ -2045,12 +2045,11 @@ static void draw_tab_overlay(void) {
int tw = widths[k];
int mw = icon_sz + icon_gap + tw;
bool is_cursor = active && app->focus_member == m;
if (is_cursor)
draw_rect(pen - 2, ry - 1, mw + 4, row_h,
draw_rect(pen - 2, ry - 1, mw + 4, row_h,
0.22f, 0.22f, 0.25f, 1.0f);
if (is_cursor)
draw_rect(pen - 2, ry - 1, mw + 4, row_h,
0.24f, 0.36f, 0.60f, 0.9f);
0.24f, 0.36f, 0.60f, 0.9f);
int mx = pen, my = iy;
if (m->icon_tex) {
GLfloat tint[4] = { active ? 1.0f : 0.72f,
@ -2250,8 +2249,7 @@ static void draw_tab_overlay_pass(struct wlr_render_pass *pass) {
int tw = widths[k];
int mw = icon_sz + icon_gap + tw;
bool is_cursor = active && app->focus_member == m;
if (is_cursor)
overlay_pass_rect(pass, pen - 2, ry - 1, mw + 4, row_h,
overlay_pass_rect(pass, pen - 2, ry - 1, mw + 4, row_h,
0.22f, 0.22f, 0.25f, 1.0f);
if (is_cursor)
overlay_pass_rect(pass, pen - 2, ry - 1, mw + 4, row_h,

View file

@ -564,6 +564,43 @@ def test_standalone_headless_overlay_clears_on_alt_release(standalone_session):
assert s.proc.poll() is None
def test_standalone_headless_overlay_title_chip_grey(standalone_session):
"""Every overlay title sits on its own dark-grey chip (0.22/0.22/0.25,
i.e. RGB ~56/56/64 -- distinct from the box interior ~18/18/23, the box
border ~115/115/122 and the red/blue client content). Regression: an
accidental `if (is_cursor)` gate left non-cursor titles -- every
background tab row -- with no chip behind them at all."""
s = standalone_session
s.wait_any_active()
s.wait_active_frame()
def grey_chip_pixels():
w, h, px = s.ppm_rgb(s.dump_host())
n = 0
for i in range(0, len(px) - 2, 3):
if abs(px[i] - 56) <= 4 and abs(px[i + 1] - 56) <= 4 \
and abs(px[i + 2] - 64) <= 4:
n += 1
return n
# Without the overlay the frame is pure client content: no chip colour.
before = grey_chip_pixels()
assert before < 20, f"chip grey already present before Alt ({before} px)"
s.mods(ALT)
deadline = time.monotonic() + 15.0
count = 0
while time.monotonic() < deadline:
count = grey_chip_pixels()
if count >= 200:
break
assert count >= 200, \
f"overlay title chips missing: only {count} grey pixels with Alt held"
s.mods(0)
assert s.proc.poll() is None
def test_standalone_headless_cursor_visible(standalone_session):
"""The standalone output shows a real cursor. The headless backend has no
cursor plane, so wlroots composites the software cursor into the frame