summaryrefslogtreecommitdiff
path: root/src/macos/pardes.h
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-16 12:00:52 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit556c5b50bbfd4a6aaae192377d7810f610fc7d9e (patch)
treed2acef085c6e6589fbf94936702222d914abc86a /src/macos/pardes.h
parent0b54c599fa5e26fb1754ca0aab53da5fa0e14af1 (diff)
downloadpardes-556c5b50bbfd4a6aaae192377d7810f610fc7d9e.tar.gz
pardes-556c5b50bbfd4a6aaae192377d7810f610fc7d9e.zip
Let WindowOpacity through on macOS
The builtin was gated on the SDL platform, so the macOS shell never registered it and the setting had nowhere to land. macOS already had transparency, but only the binary kind a theme decides — a theme with no background of its own drops the ground and the blur shows through. WindowOpacity is the graded, theme-independent version, and the window had no way to hear about it. pardes_window_opacity reports the percentage and acknowledges the request in one read, beside pardes_theme_bg: an SDL surface can arrive without an alpha channel and has to be able to refuse, while an AppKit window always composites per pixel, so there is nothing here to refuse and no rollback to perform. The view then paints the rule shaders/ui.frag.glsl states for the SDL shell: backgrounds — ground, cell and band fills, and the chrome rules over them — take the alpha, glyph ink never does, and the block cursor is exempt because it is foreground chrome that happens to be carried in a cell background. That exemption is why the cursor joins the colour in the background run key; it can no longer share a fill with the cells beside it. Two things the harness was missing fall out of testing it: it never adopted the theme background or the opacity, so a Theme or WindowOpacity in a script moved the core and never reached a pixel. draw-opacity records both ends of the alpha range, which is what makes the two-sided contract assertable — 60% reads 153..255, and 0% reads 0..255 with the ink still standing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Diffstat (limited to 'src/macos/pardes.h')
-rw-r--r--src/macos/pardes.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/macos/pardes.h b/src/macos/pardes.h
index 48f38e58..5f1ccf77 100644
--- a/src/macos/pardes.h
+++ b/src/macos/pardes.h
@@ -254,6 +254,15 @@ bool pardes_animating(void);
// wear, so the host should go transparent and show its own backdrop.
uint32_t pardes_theme_bg(void);
+// The percentage the host must paint window BACKGROUNDS at: the ground behind
+// the grid, cell and band backgrounds, and the chrome rules over them. Glyph
+// ink and the block cursor are never scaled by it — see shaders/ui.frag.glsl,
+// which states the same rule for the SDL shell.
+//
+// Read it once per pump beside pardes_theme_bg(): reading also acknowledges
+// whatever `WindowOpacity` asked for. 100 is opaque and is the default.
+uint8_t pardes_window_opacity(void);
+
// Pane taglines use this percentage of the current body font size. It is the
// embedded default before init and the live core setting afterwards; the host
// polls it and rebuilds only tagline glyph/metric state.