fix(viewer): stop webpage transitions flashing a foreign page - #3160
Merged
Conversation
- Collapse the webpage renderer to a single QWebEngineView on every board, not just low-RAM ones - The preloaded second buffer never composited its new page on the Qt6 boards' single fullscreen surface (hidden/occluded QWebEngineView is frame-throttled), so revealing it flashed the page it last showed two rotations earlier for ~1 frame on each transition - An in-place load() on the visible view holds the current page until the next paints: seamless, at worst a brief black frame, never a foreign page - Drop the now-obsolete ANTHIAS_LOW_RAM viewer flag and its plumbing; the independent 1080p upload cap (host:total_mem_kb) is untouched - Reclaims ~100 MB on 2 GB+ boards as a bonus Live-reproduced and fix live-verified on a Pi 5: every transition flashed the (n-2) page before, none after. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR fixes webpage→webpage transitions that briefly flashed an unrelated (“n-2”) page on Qt6 single-surface platforms by removing the off-screen preloaded QWebEngineView path and standardizing on a single in-place QWebEngineView navigation model across all boards.
Changes:
- Collapse webpage rendering to a single
QWebEngineViewunconditionally; remove the legacyANTHIAS_LOW_RAM-gated dual-buffer mode. - Remove
ANTHIAS_LOW_RAMplumbing from container upgrade/export and compose template. - Update board enablement documentation to reflect the new single-view renderer behavior and rationale.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/anthias_webview/src/view.cpp | Removes low-RAM gating and aliases webView2 to webView1 to eliminate off-screen preloading that caused stale-frame flashes. |
| docs/board-enablement.md | Updates “Low-RAM mode” section to document removal of the preloaded second QWebEngineView path and why. |
| docker-compose.yml.tmpl | Removes ANTHIAS_LOW_RAM from viewer container environment. |
| bin/upgrade_containers.sh | Removes ANTHIAS_LOW_RAM export logic; documents new behavior and notes upload cap remains server-side. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses review feedback on the #2954 fix. With webView2 aliased onto webView1 the swap only hid then re-showed the same widget and swapped two pointers that always alias; the "no-op" comment was also inaccurate. - Add a `currentWebView == nextWebView` fast path: show the one view (it may have been hidden by a preceding image/video asset) and arm the refresh timer, skipping the pointless hide/show toggle and swap - Correct the constructor comment accordingly No behaviour change for webpage rotation; re-verified on a Pi 5 that webpage→webpage stays flash-free and image→webpage still shows the page. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot review follow-up: with the single-view collapse there is no off-screen buffer, so the load log lines saying "background web view" / "Background web page" were misleading during troubleshooting. Reword to plain "Loading web page" / "Web page loaded|failed". Log-string only, no behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issues Fixed
Fixes #2954 — webpage asset transitions briefly flash another page in rotation.
Description
On the Qt6 boards (Pi 5 / x86 on Wayland/cage, pi4-64 on eglfs) the viewer
rendered URL assets through a two-
QWebEngineViewping-pong: the next pagewas loaded into an off-screen buffer and swapped in on
loadFinished. But ahidden or sibling-occluded
QWebEngineViewis frame-callback-throttled byChromium on the single fullscreen surface these boards use — it never
composited the preloaded page. So the swap revealed a buffer whose GPU
surface still held the page it had last shown two rotations earlier,
which flashed for ~1 frame before the new page painted — an unrelated asset
on every webpage→webpage transition.
The fix collapses webpage rendering to a single
QWebEngineViewon everyboard (the path the 1 GB low-RAM boards already ran). An in-place
load()on the visible view keeps the current page composited until the next one
paints, so transitions are seamless — at worst a brief black frame, never a
foreign page. The now-obsolete
ANTHIAS_LOW_RAMviewer flag and itscompose/upgrade plumbing are removed; the independent 1080p upload cap
(
is_low_ram_deviceviahost:total_mem_kb) is untouched. Reclaims the~100 MB the second renderer cost on 2 GB+ boards as a bonus.
Validation (live on a Pi 5, grim burst-capture of a 4-page 10 s
rotation): baseline flashed the exact (n-2) page at every transition; after
the fix, 0 foreign flashes across 7 transitions, all seamless.
Memory & slow-load regression check
Removing
ANTHIAS_LOW_RAMmakes single-view universal, so the naturalquestion is whether the 2 GB+ boards lose the dual-buffer's seamless
crossfade and instead get the "brief blank during load" that #2915's commit
message noted for the 1 GB path. Measured on a Pi 5 with a page whose
HTTP response is delayed 5 s, rotated against instant pages, dual-buffer vs
single-view side by side (grim burst-capture, 1205 frames each):
QtWebEngine holds the last composited frame across an in-place
load()until the new page first-paints, even for a multi-second load — so there is
no blank-during-load regression; single-view is seamless and
flash-free. The 1080p upload cap and the diagnostics "Low-RAM mode" banner
are unaffected (separate
is_low_ram_device()/host:total_mem_kbpath).On the RockPi 4 (1 GB) the change is a no-op — it already ran single-view
(
ANTHIAS_LOW_RAM=1); verified 1 QtWebEngine renderer, stable memory whilecycling webpage assets.
Checklist