Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ea83962
zig: the 0.17 switch, scaffolded with marked stand-ins (#437)
foxnne Oct 16, 2026
9a22df2
zig: the build's custom steps become helper programs (#438)
foxnne Oct 16, 2026
2491f4e
zig: release packaging on 0.17, with Velopack 1.2.161 (#448)
foxnne Oct 16, 2026
b18213c
backend: no crash quitting a plain dvui app on macOS (#480)
foxnne Oct 17, 2026
a59ff14
backend: a plain dvui app's floating windows open as OS windows (#481)
foxnne Oct 17, 2026
67cc6ea
macos: a plain dvui app's windows take fizzy's window shape (#482)
foxnne Oct 17, 2026
78a5019
macos: child windows stay above the main window (#483)
foxnne Oct 17, 2026
46ddcd8
zig/0.17: merge main (40 commits, to #469)
foxnne Oct 17, 2026
6d94889
zig/0.17: merge main (40 commits, to #469) (#486)
foxnne Oct 17, 2026
28766fa
zig: settings and command schemas read 0.17's @typeInfo (#488)
foxnne Oct 17, 2026
b45233a
zig: a lifted view keeps its drag through dvui's captureMouseGet (#489)
foxnne Oct 17, 2026
a1feb78
docs: the Windows traps of the Zig 0.17 move (#494)
foxnne Oct 18, 2026
300d797
core: a transparent blit reads its pixels as bytes on Zig 0.17 (#496)
foxnne Oct 18, 2026
1b6ad2c
sdk: a plugin can install a program beside itself (#498)
foxnne Oct 18, 2026
0be3e64
zig/0.17: record #486's merge of main as a parent
foxnne Oct 18, 2026
47a0c1e
zig/0.17: merge main (6 commits, to #490)
foxnne Oct 18, 2026
87ae2ae
zig: what 0.16 needed goes with the move (#505)
foxnne Oct 18, 2026
3513b9f
macos: a plain dvui app's OS windows are ordinary document windows (#…
foxnne Oct 18, 2026
eb452e8
backend: OS windows for the floating windows that ask, or all by choi…
foxnne Oct 18, 2026
7336d4a
macos: a float's full screen at the display's rate, clear and rounded…
foxnne Oct 18, 2026
2dc6fc4
macos: the pointer reaches the window it is over, not one behind it (…
foxnne Oct 18, 2026
4eca7f6
core: one window material, and the kinds each backend can show
foxnne Oct 18, 2026
d2128cb
app: every glass draws in the window material
foxnne Oct 18, 2026
9f5fc85
backend: a floating window dragged past the app's windows tears off (…
foxnne Oct 18, 2026
9e8e530
zig/0.17: merge main (22 commits, to #509) (#558)
foxnne Oct 18, 2026
e118432
zig/0.17: merge into backend/window-materials (to #558)
foxnne Oct 18, 2026
18c1631
Merge backend/window-materials into app/glass-material
foxnne Oct 18, 2026
54014c7
zig: settings own only strings, and builds read through b.root (#561)
foxnne Oct 18, 2026
39574be
core: one window material, and the kinds each backend can show (#546)
foxnne Oct 18, 2026
0b0f9e0
Merge zig/0.17 into app/glass-material
foxnne Oct 18, 2026
ae5e719
backend: plain dvui app windows made of the window material (#565)
foxnne Oct 18, 2026
9d9dbee
Merge main into app/glass-material
foxnne Oct 18, 2026
e17b4ce
macos: a window's glass bevel follows a live resize (#576)
foxnne Oct 18, 2026
d6732b6
backend: fizzy's in-app glass is the backend's, core re-exports it
foxnne Oct 18, 2026
2aa641c
main: merge into backend/glass-module
foxnne Oct 18, 2026
672f668
backend: a plain app's in-app floating windows are made of the window…
foxnne Oct 18, 2026
27eae42
backend: a plain dvui app's frame draws through FrameTarget
foxnne Oct 18, 2026
fb5a3e0
backend/plain-frame-target: merge into backend/material-floats
foxnne Oct 18, 2026
441be69
main: merge into backend/plain-frame-target
foxnne Oct 18, 2026
b2ff701
backend/plain-frame-target: merge into backend/material-floats
foxnne Oct 18, 2026
46c95e6
main: merge into backend/plain-frame-target
foxnne Oct 18, 2026
f9914f5
backend/plain-frame-target: merge into backend/material-floats
foxnne Oct 18, 2026
bafe379
main: merge into backend/plain-frame-target
foxnne Oct 19, 2026
33a2b76
backend/plain-frame-target: merge into backend/material-floats
foxnne Oct 19, 2026
296c07a
main: merge into backend/plain-frame-target
foxnne Oct 19, 2026
8f97440
backend/plain-frame-target: merge into backend/material-floats
foxnne Oct 19, 2026
862544e
backend: a light theme's window material is half as tinted
foxnne Oct 19, 2026
e568a09
backend: glass never goes fully clear; a clear window may
foxnne Oct 19, 2026
d573712
main: merge into backend/material-floats
foxnne Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ pub fn backendModule(dep: *std.Build.Dependency, dvui_mod: *std.Build.Module, op
m.addCSourceFile(.{ .file = b.path("src/macos_monitor.m") });
}
m.addImport("glass_look", glassLookModule(dep));
// A plain dvui app's frame is drawn through the glass's frame target (`plainFrameBegin`). The
// A plain dvui app's frame is drawn through the glass's frame target (`plainFrameBegin`), and
// its floating windows are made of the glass (`floatingWindowBackground`). The
// same module as the app's `core` takes (`glassModule`, one per dvui); it imports dvui, never
// the backend.
m.addImport("glass", glassModule(dep, dvui_mod));
Expand Down
74 changes: 69 additions & 5 deletions backend/src/SDLBackend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ pub const viewports = @import("viewports.zig");
pub const os_windows = @import("os_windows.zig");
/// What this backend keeps count of as it runs (`health`).
pub const Health = @import("Health.zig");
/// Fizzy's in-app glass (`src/glass/`): here for `FrameTarget`, a plain dvui app's frame drawn
/// into a texture (`plainFrameBegin`).
/// Fizzy's in-app glass (`src/glass/`): a plain dvui app's frame drawn into a texture
/// (`FrameTarget`, `plainFrameBegin`), and its floating windows made of the window material
/// (`floatingWindowBackground`).
pub const glass = @import("glass");

/// What an app gets from its window beyond drawing into it: native dialogs, files the OS hands
Expand Down Expand Up @@ -1116,20 +1117,38 @@ pub fn setWindowMaterial(material: MaterialKind, opacity: f32) void {
window_material = .{ .kind = material, .opacity = opacity };
}

/// `window_material`, or the best kind below it this backend can show (`materialKinds`).
/// `window_material`, or the best kind below it this backend can show (`materialKinds`), its
/// colour less opaque in a light theme (`light_tint`).
fn effectiveMaterial(self: *SDLBackend) WindowMaterial {
const offered = self.materialKinds();
// In a light theme the window's colour is light over a desktop that is mostly darker, and at
// the opacity a dark theme reads well at, little showed through it (the user): a light theme's
// colour covers `light_tint` as much. Fizzy's own defaults are the same ratio (`app/settings`:
// 0.7 dark, 0.3 light), which fizzy's people set apart; a plain app has the one value.
const opacity = if (dvui.themeGet().dark) window_material.opacity else window_material.opacity * light_tint;
var k = @backingInt(window_material.kind);
while (k > 0) : (k -= 1) {
const material: MaterialKind = @fromBackingInt(k);
const has = switch (material) {
inline else => |t| @field(offered, @tagName(t)),
};
if (has) return .{ .kind = material, .opacity = window_material.opacity };
// Glass keeps a little of the window's colour (`material_min_opacity`); a clear window may
// have none.
if (has) return .{ .kind = material, .opacity = if (material == .transparent) opacity else @max(opacity, material_min_opacity) };
}
return .{ .kind = .none, .opacity = window_material.opacity };
return .{ .kind = .none, .opacity = opacity };
}

/// The least of the window's colour a material other than a clear window covers what is behind
/// with: at none, glass is no glass — `glass_look`'s 0, a clear window — and the slider's last
/// stretch went from a material to none of it (the user). Only `transparent` goes to 0. An app's
/// own slider stops here (fizzy's does, at the same `glass_look.min_opacity`).
pub const material_min_opacity: f32 = glass_look.min_opacity;

/// How much of a light theme's window colour covers what is behind, beside a dark theme's at the
/// same material opacity (`effectiveMaterial`).
const light_tint: f32 = 0.3 / 0.7;

/// The OS's own title bar on a plain dvui app's windows — the main one and each of the OS's own
/// frame (`Viewport.native`) — in the theme's colour, made of the window material: set again only
/// when the theme's colours or the material change. A window opening is dressed as it opens
Expand Down Expand Up @@ -1238,6 +1257,51 @@ pub fn floatingWindowTitle(_: *SDLBackend, id: dvui.Id, header: []const u8) bool
return os_windows.titled(id, header);
}

/// A floating window of a plain dvui app's, drawn in the main window, made of the window material
/// (`window_material`, as the backend can show it), as fizzy's own glass is at the same material
/// (`Editor`'s dialog style): dvui asks where it would fill the window with the theme's colour
/// (`dvui.Backend.floatingWindowBackground`), with the fill's `rect` and `corners`.
/// - `none`: dvui's fill, opaque (false: dvui draws it).
/// - `transparent`: the theme's window colour at the material's opacity over what is behind.
/// - `frost`, `blur`: what is behind it in the app, frosted (`BlurBackdrop.frostPane`) under that
/// colour — the frosted pane at the opacity (`glass_look.frosted`), half its blur for `blur`.
/// - `liquid`: the same, its edge bending what is behind; on macOS with the glass program, Apple's
/// lens, as the window's own Liquid Glass is beside it (`glass_look.inApp`).
/// A window fizzy's own frame dresses (`platform.window.app_dresses_windows`) is fizzy's to draw:
/// its floating windows are its own widget, which never asks.
pub fn floatingWindowBackground(self: *SDLBackend, id: dvui.Id, rect: dvui.Rect.Physical, corners: dvui.CornerRect.Physical) bool {
if (platform.window.app_dresses_windows) return false;
const m = self.effectiveMaterial();
const fill = dvui.themeGet().color(.window, .fill);
switch (m.kind) {
.none => return false,
.transparent => {
rect.fill(corners, .{ .color = .{ .color = fill.opacity(std.math.clamp(m.opacity, 0, 1)) }, .fade = 1 });
return true;
},
.blur, .frost, .liquid => {
const opacity = m.opacity;
const pane = glass_look.frosted(opacity);
const liquid = m.kind == .liquid;
// What the glass draws with, as fizzy publishes it each frame (`Editor`): the program
// API, and the lens's look while the window is Liquid Glass.
glass.programs.publishHost();
glass.LiquidField.publishEnabled(liquid);
const lens = builtin.target.os.tag == .macos and liquid and glass.LiquidField.ready();
glass.LiquidField.publishLook(if (lens) glass_look.inApp(opacity) else null);
const s = dvui.windowNaturalScale();
glass.BlurBackdrop.frostPane(id, rect, corners.scale(1 / s, dvui.CornerRect), s, .{
.radius = if (lens) glass_look.text_blur else if (m.kind == .blur) pane.blur / 2 else pane.blur,
.tint = fill,
.mix = pane.mix,
// Twice the setting, as fizzy's dialogs bend (`core.dialogs.refraction`).
.refraction = 2 * (if (lens) 1 else if (liquid) pane.refraction else 0),
});
return true;
},
}
}

/// The kinds of window material this backend can show (fizzy's `core.material`, field for field):
/// only a kind every surface it puts glass on can show. A clear window everywhere (`transparent`);
/// on macOS vibrancy (`frost`) and a plain blur, and Liquid Glass from macOS 26; on Windows
Expand Down
10 changes: 8 additions & 2 deletions docs/DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ as `git+https`: the eight above rebased onto upstream `main` (`41f6703`), then:
13. **The pointer and its cursor** (`48496b7`, `186a87f`, `1b29a16`): `Window` knows the pointer's
kind and a lifted finger hovers nothing; `cursorSet` takes a priority, so a resize handle's
cursor wins, and a floating window's edges ask at normal priority.
14. **floatingWindow: the backend may draw a floating window's background** (`3d90fdd`):
`Backend.floatingWindowBackground(id, rect, corners)`, asked where `FloatingWindowWidget` would
fill its background (after its shadow and border, its subwindow current, before its content).
True: the backend drew it, and dvui draws no fill. Fizzy's backend draws a plain app's floating
windows in the window's material there: a frosted backdrop of what is under them needs the
backend's render targets at that point of the replay, which a theme fill cannot express.

Tags: `fizzy-sdk-0.2.13` → `712f7f7` (the stack before this rebase, still what SDK ≤ 0.2.15
builds); `fizzy-sdk-0.2.16` → `4428108` (SDK 0.2.16 to 0.2.18); `fizzy-sdk-0.2.19` →
Expand All @@ -165,8 +171,8 @@ moves, so the second pin of one version takes a suffix, as the SDL fork's tags d
`fizzy-sdk-0.2.30-3` → `cc60612` (never
pinned); `fizzy-sdk-0.2.30-4` → `44010a3`; `fizzy-sdk-0.2.30-5` →
`20e56f1` (never pinned on `main`); `fizzy-sdk-0.2.30-6` → `40e664c`, the last pin on Zig 0.16;
`fizzy-sdk-0.2.30-7` → `1b29a16` on `zig-0.17`, what `sdk/build.zig.zon` pins now (SDK 0.2.30, the
first on Zig 0.17).
`fizzy-sdk-0.2.30-7` → `1b29a16` on `zig-0.17` (SDK 0.2.30, the first on Zig 0.17);
`fizzy-sdk-0.2.30-8` → `3d90fdd` (item 14), what `sdk/build.zig.zon` pins now.

Fizzy builds dvui in its `custom` backend mode on every target and links its own backends
(`backend/`, `src/backend/WebBackend.zig` + `web/web.js`), so dvui's `sdl3` and `web`
Expand Down
7 changes: 4 additions & 3 deletions sdk/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
// `fizzy-sdk-<version>` tag in the fork before the pin lands. `fizzy-dev` itself stays a
// working branch and can be rebased freely — the tag, never.
.dvui = .{
// fizzy-sdk-0.2.30-7, on the zig-0.17 branch (docs/DEPENDENCIES.md)
.url = "git+https://github.com/foxnne/dvui-dev#1b29a16d0340005c0d5ed2b689a7ffab797b1c37",
.hash = "dvui-0.6.0-dev-AQFJmXGtBAE8dNSt4nGJ7ToMZ9HR7rdMVubvTlhzO-mk",
// The zig-0.17 branch: fizzy-sdk-0.2.30-7 and the floating window background hook after
// it (docs/DEPENDENCIES.md, patch 14)
.url = "git+https://github.com/foxnne/dvui-dev#3d90fdda949d50ba7fa82117ccb18a40da5b41cc",
.hash = "dvui-0.6.0-dev-AQFJmTG2BAHCy_MTZv6SjCTs3xHXSOPuxEsON67RQ7uS",
//.path = "../../dvui-dev",
},
.zf = .{
Expand Down
Loading