Skip to content

dvui: the demo opens under the app's windows, the main window themed - #7

Closed
foxnne wants to merge 9 commits into
zig-0.17from
dvui/plain-windows
Closed

foxnne wants to merge 9 commits into
zig-0.17from
dvui/plain-windows

Conversation

@foxnne

@foxnne foxnne commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

On fizzy's zig/0.17, every floating window that isn't modal is now an OS window with the OS's title bar in the theme's colour, kept above the main window (fizzyedit/fizzy#480–#483). This brings the dvui example up to date with that:

  • The demo is drawn before the app's own dvui.osWindows. It was drawn last, so its window opened over theirs and, being centred and much larger, hid them.
  • The main window's content has the theme's window background. It was transparent before.
  • The header comment describes what the backend now does: OS title bars, and the demo is an OS window too. On dvui's SDL3 backend, dvui.osWindow still opens a dvui.Window of its own.

The pins are unchanged, as for the rest of this branch: fizzy's check-examples.sh swaps them for its own tree.

Tested: zig build and zig build dvui on macOS, against fizzy zig/0.17 at 78a50195. The window order was seen by hand earlier, on the same code before the split.

🤖 Generated with Claude Code

t and others added 4 commits October 17, 2026 10:24
On fizzy's backend every floating window is now an OS window with the
OS's title bar (fizzyedit/fizzy#480-#483, on zig/0.17). The demo was
drawn last, so its window opened over the app's own and hid them; it is
drawn first now. The main window's content gets the theme's window
background, and the header says what the backend does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The branch's own CI installed Zig 0.16 and failed at build.zig, and on
0.17 its pins (fizzy's 0.16 releases) would fail as well until fizzy's
first 0.17 SDK is released. So it runs fizzy's check-examples.sh on
fizzy's zig/0.17 with this checkout and example-plugin's zig-0.17 in
place of the pins: every shape, the replay app and the dvui app on both
backends, on Zig 0.17. Back to building the pins at the merge (ZIG017).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ain window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d out

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
t and others added 2 commits October 18, 2026 12:02
"New window" opens an in-app floating window, which on fizzy's backend
drags out into an OS window of its own; "New OS window" opens a
dvui.osWindow. A dropdown and a transparency slider pick what the
windows are made of (opaque, clear, blur, frost, Liquid Glass), the
colour the theme's window colour; the main window draws no fill of its
own, so the material shows through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne added a commit to fizzyedit/fizzy that referenced this pull request Oct 18, 2026
Part of the window material (fizzyedit/plans#27, "backend: apply the
effective material to every OS window") and the multi-window plan
(fizzyedit/plans#26). Stacked on #549.

**One decision, one applier** (agreed with fizzy-1d):
- `core.material` decides, and fizzy's Entry publishes the effective
value.
- The backend applies it. Entry hands the same value to the backend each
frame, right after the publish (`setWindowMaterial`).
- `backend/` doesn't depend on `core`, so the backend has a plain-typed
twin: `MaterialKind`, field for field, and `window_material`.

**What the backend does,** for the windows it dresses itself
(`dressPlainWindows`: a plain dvui app's main window and its OS-framed
floats):
- Falls back from the kind asked to what it can show
(`effectiveMaterial`, same order as `core.material`).
- Keeps the theme's window colour as the backdrop, at the opacity asked
(opaque for `none`).
- Under it, the OS's vibrancy: the window's frosted material for frost,
the full-screen-UI one for blur.
- **Liquid is fizzy's own window glass**, not Apple's bare glass: the
same parts fizzy's windows stand on (`windowGlassInstall`: lens, frost
body, plain blur, colour) and the same look each frame
(`glass_look.window` at the material's opacity, the clearing bevel by
the window's size), over a clear backdrop. Choosing another material
removes the parts. The first version, one `NSGlassEffectView` clipped to
the corners (`masksToBounds`), looked unlike fizzy and cost a lot.
- The material follows the backdrop exactly, including through the
full-screen animation (`glass_follow`).
- A float's window opened later takes the same material.

**`glass_look` moves into the backend** so it can use it:
`core/gfx/glass_look.zig` → `backend/src/glass_look.zig`, a std-only
module of its own.
- The backend's build makes one instance per build (`glassLookModule`).
`core` takes that same instance where it is linked beside the backend
(`core_module.addImports`' new argument), since a file may belong to
only one module.
- Web, the tests and the plugin SDK make their own instance from the
file. `repoPath` moves to `core_module` for that.
- `scripts/pack-sdk.sh` vendors the file into the SDK tarball beside
`core/`.

**Not yet:**
- **Fizzy's own windows** (it dresses them itself:
`app_dresses_windows`) don't take the material yet. That's the next step
on plans#27.
- **In-app floating windows** in the matching material: the next step
after this one.
- **Windows and Linux:** `platform.window.plainMaterial` is macOS only.

## SDK impact

- [x] None. The plugin boundary is unchanged. The SDK tarball now
carries `backend/src/glass_look.zig` (checked: `scripts/pack-sdk.sh`
output lists it in `.paths`).

## Verified

- [x] macOS (arm64, Zig 0.17.0): `scripts/check-fmt.sh`, `zig build`,
`zig build test`, `zig build check-tests-reached`, `zig build
check-web`, `zig build test-sdk-version`, `zig build test-integration`
all pass.
- [x] `plugins/image` builds against `sdk/` (a sandbox `FIZZY_PROFILE`).
- [x] By hand on `run-dvui` (fizzyedit/example-app#7): each material and
the transparency slider, on the main window and an OS window.
- [ ] By hand: Liquid Glass's look and cost against the first version,
side by side.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
foxnne and others added 2 commits October 18, 2026 17:59
fizzy pins its Zig 0.17 switch (fizzyedit/fizzy#575), fizzy_sdk and the shader plugin pin sdk-v0.2.30, hello pins example-plugin's 0.17 branch, and the workflow builds with Zig 0.17.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zig-0.17 now builds against fizzy's pinned Zig 0.17 switch and SDK 0.2.30,
and fizzy's zig/0.17 branch this PR's CI checked out is gone (merged to
main). CI takes zig-0.17's steps, and builds the dvui app beside them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zig-0.17 was rewritten (46fd900 became 205018b), moving the example-plugin
pin; the base's pin is kept. This branch still adds only its dvui app and
the CI step that builds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne deleted the branch zig-0.17 October 19, 2026 03:31
@foxnne foxnne closed this Oct 19, 2026
foxnne added a commit to fizzyedit/fizzy that referenced this pull request Oct 19, 2026
… material (#589)

Part of the window material (fizzyedit/plans#27): in-app floating
windows in the material, for a plain dvui app on fizzy's backend.
Stacked on #586 (the glass in the backend); shows its frost once the
plain app's frame draws through `FrameTarget` (the step 2 PR from the
same stack).

**What changes:** a plain dvui app's floating window drawn inside the
main window is now made of the window material, the same as the main
window and its OS windows. Before, it was dvui's opaque theme fill
whatever the material was.

| Material | In-app floating window |
|---|---|
| none | dvui's fill, opaque (unchanged) |
| transparent | the theme's window colour at the material's opacity |
| frost | what's under the window, frosted, under that colour
(`BlurBackdrop.frostPane` at `glass_look.frosted(opacity)`) |
| blur | the same at half the blur |
| liquid | the same, its edge bending what's behind; on macOS with the
glass program, Apple's lens (`glass_look.inApp`), as the OS's Liquid
Glass is beside it |

That's the mapping fizzy's own dialogs and menus use (`Editor`'s dialog
style).

**How:**
- **dvui-dev 3d90fdd** (repinned in `sdk/build.zig.zon`) adds
`Backend.floatingWindowBackground(id, rect, corners)`:
- dvui asks it where `FloatingWindowWidget` would fill its background:
after its shadow and border, its subwindow current, before its content;
  - true: the backend drew the background, and dvui draws no fill;
- documented in dvui-dev's commit and in `docs/DEPENDENCIES.md` (patch
14), with the reason: a frosted backdrop needs the backend's render
targets at that point of the replay, which a theme fill can't express.
- **The backend's answer** is `SDLBackend.floatingWindowBackground`:
- it publishes what the glass draws with (the program API, the lens's
look) as fizzy's `Editor` does each frame, then draws the pane;
- fizzy's own windows never ask (`app_dresses_windows`), since its
floating windows are its own widget.

**The dvui-dev tag.** `sdk/build.zig.zon` keeps every pinned dvui-dev
commit alive with an immutable `fizzy-sdk-<version>` tag. This pins
3d90fdd, tagged `fizzy-sdk-0.2.30-8` (done; `docs/DEPENDENCIES.md` lists
it).

**Two more, from the user's testing:**
- **A light theme's window material is half as tinted.** A light theme's
colour is light over a desktop that's mostly darker, and at a dark
theme's opacity little showed through. In a light theme the colour now
covers 0.3/0.7 as much (`light_tint`, in `effectiveMaterial`, so every
window alike): the ratio of fizzy's own defaults (0.7 dark, 0.3 light),
which fizzy's people set apart and a plain app can't.
- **Glass never goes fully clear; a clear window may.** At an opacity of
0, blur, frost and Liquid Glass were no glass at all. They now keep
`glass_look.min_opacity` of the colour (`material_min_opacity`,
published for an app's own slider to stop at, as fizzy's does). Only
`transparent` goes to 0. fizzyedit/example-app#7's slider stops there.

## SDK impact

- [x] None (`test-sdk-version` passes; the new dvui-dev commit adds an
optional backend hook and moves no boundary type).

## Verified

- [x] macOS (arm64, Zig 0.17.0): `scripts/check-fmt.sh`, `zig build`,
`zig build test`, `zig build check-tests-reached`, `zig build
check-web`, `zig build test-sdk-version`, `zig build test-integration`
all pass.
- [x] By hand on `run-dvui` (the user, macOS 26), with the offscreen
frame: each material on an in-app window; themes, light and dark.
- [x] Gates on the latest head: `scripts/check-fmt.sh`, `zig build`,
`test`, `check-tests-reached`, `check-web`, `test-sdk-version`,
`test-integration` all pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant