Add layout diagnosis: font metrics in the log, --snapshot option
On the Steam Frame, the fixed 1200x800 QML layout overflows: about the bottom quarter is cut off and the navigation icons overlap their text. Forcing 96 DPI and switching the Quick Controls style didn't help, so the cause has to be measured rather than guessed. - SetWidget() logs the application font (family, pt, px), what 20 pt (MyText) is in px, the screen's DPI and the device pixel ratio. - --snapshot <file> writes the rendered overlay (RenderBackend::readback) as PNG at most once per second while it is visible. A time interval, because OVRAS only renders when the scene changes. Written to a temporary file and renamed, so readers never see a partial file. - run.sh passes arguments after the graphics API to the program. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -260,6 +260,27 @@ existing code:
|
||||
private API.
|
||||
- RPATH is only `$ORIGIN` (`BUILD_WITH_INSTALL_RPATH`): the build tree gets packaged.
|
||||
|
||||
## 10. Layout diagnosis: font log and `--snapshot` (approved 2026-10-08)
|
||||
|
||||
**Why:** on the Frame the fixed 1200×800 layout overflows: the bottom quarter is cut off
|
||||
(left: Statistics, Bindings, Settings; right: Microphone, Push-to-Talk), and the navigation
|
||||
icons overlap their text. `QT_FONT_DPI=96`, `QT_QUICK_CONTROLS_STYLE=Basic` and the Material
|
||||
"Dense" variant didn't fix it. Font metrics (Noto Sans instead of Segoe UI) are the main
|
||||
suspect; measuring needs the unwarped rendered image.
|
||||
|
||||
**Changes (platform-neutral):**
|
||||
- `OverlayController::SetWidget()`: logs once the application font (family, pt, px), what
|
||||
20 pt (`MyText`) is in px, the screen's logical/physical DPI and the window's device pixel
|
||||
ratio.
|
||||
- Option `--snapshot <file>` (`setup.*`, `main.cpp`, `overlaycontroller.*`): while the
|
||||
overlay is visible and rendered, `renderOverlay()` writes `RenderBackend::readback()` as
|
||||
PNG to `<file>`, at most once per second (OVRAS only renders when the scene changes, so a
|
||||
frame count could never trigger on a still page). Written to `<file>.tmp` and renamed.
|
||||
`main.cpp` passes it through a setter, not a new constructor parameter, to keep the diff
|
||||
small. Without the option nothing changes.
|
||||
- `run.sh`: arguments after the graphics API go to the program
|
||||
(`./run.sh opengl --snapshot /tmp/ovras.png`).
|
||||
|
||||
## Tests
|
||||
|
||||
- **x86_64 locally:** the build succeeds; `objdump` check (R1).
|
||||
|
||||
@@ -266,6 +266,28 @@ URL: "steam://launch/1009850/openvroverlay" auto-launch: true`.
|
||||
- **Open for R6/T10:** each tick makes three synchronous PulseAudio queries (server info,
|
||||
all sinks, all sources) for the mute state. Not changed now.
|
||||
|
||||
### Layout cut off on the Frame; diagnosis tools (2026-10-08)
|
||||
|
||||
- **Observed (headset photo):** the dashboard tab appears, navigation and laser work. The
|
||||
fixed 1200×800 layout overflows: about the bottom quarter is cut off (left: Statistics,
|
||||
Bindings, Settings; right: Microphone half, Push-to-Talk). Navigation icons overlap their
|
||||
text. The right edge is complete.
|
||||
- **Ruled out by experiment on the Frame:** `QT_FONT_DPI=96` (verified in the process
|
||||
environment): no change. `QT_QUICK_CONTROLS_STYLE=Basic` (Qt 5's "Default" style; `qt6`
|
||||
sets no style, so Qt 6 uses Fusion on Linux; only `mainwidget.qml` imports Material): no
|
||||
visible change. `QT_QUICK_CONTROLS_MATERIAL_VARIANT=Dense`: slightly better, still cut
|
||||
off.
|
||||
- **Facts:** Frame X screen 1920×1080, `Xft.dpi: 144`; default font Noto Sans
|
||||
(`fc-match sans-serif`). Template renders 1600×1000.
|
||||
- **Also seen:** after removing the Steam license, Steam's `steamapps.vrmanifest` still
|
||||
lists `steam.overlay.1009850` (not yet regenerated); the debug-output fix works (0 `[D]`
|
||||
lines).
|
||||
- **Diagnosis tools (DESIGN.md section 10):** font/screen metrics in the log, option
|
||||
`--snapshot <file>`, `run.sh` passes further options.
|
||||
- **Result:** cross build and package succeed, `Qt_6_PRIVATE_API` without `QVulkan*`: 0,
|
||||
generated `run.sh` checked with `sh -n`. No new warnings in the changed lines.
|
||||
- **Not tested yet:** on the Frame (log line "Font: …", PNG written).
|
||||
|
||||
### Test checklist on the Frame (step 5)
|
||||
|
||||
Deploy: `build_scripts/steamframe/deploy-to-frame.sh <user>@<frame>` (SteamVR running).
|
||||
|
||||
@@ -124,11 +124,12 @@ docker run --rm -v "$PWD:$PWD" -w "$PWD" ovras-steamframe-cross-arm64 \
|
||||
| Command | Effect |
|
||||
|---|---|
|
||||
| `./install.sh` | Registers with SteamVR (auto-start) and starts |
|
||||
| `./run.sh opengl\|vulkan` | Restarts with that graphics API |
|
||||
| `./run.sh opengl\|vulkan [options]` | Restarts with that graphics API; further options go to the program |
|
||||
| `./uninstall.sh` | Unregisters |
|
||||
| `AdvancedSettings.log` | Log (in the working directory, i.e. this folder) |
|
||||
|
||||
Program options (new): `--graphics-api opengl|vulkan` (default `opengl`). Existing ones
|
||||
Program options (new): `--graphics-api opengl|vulkan` (default `opengl`); `--snapshot <file>`
|
||||
(diagnosis: writes the rendered overlay as PNG at most once per second while visible). Existing ones
|
||||
include `--force-install-manifest` and `--force-remove-manifest`; see `--help`.
|
||||
|
||||
## Steam Frame facts the code relies on
|
||||
|
||||
Reference in New Issue
Block a user