S056: stall watchdog for the egui area, PROGRESS (bindings audit, PiP on niri, freeze not reproduced), smokes in CLAUDE.md
Freeze box stays open: not reproduced hidden or in 3 visible runs; the watchdog prints 'egui area: not drawing (...)' with frame clock state if it happens again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
0478385bcb
commit
a40b33d9ff
4 changed files with 52 additions and 4 deletions
|
|
@ -79,7 +79,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl
|
|||
| `tools/smoke.sh tests/smoke/privacy-mode.txt` (+ `SMOKE_ARGS=--incognito … privacy-incognito.txt`) | privacy mode: `pages/fingerprint.html` read off/on, `fp-off.json`/`fp-on.json` + shots (offline); `privacy-net.txt` (needs `tests/smoke/net/server.py`) frame cookies, per-site pause, Accept-Language; `SMOKE_TIMEOUT=700 … coveryourtracks.txt` EFF's test off/on (internet, direct). Selftest `save <name> <js>` writes a JS string result to `<name>.json`; `SMOKE_ARGS` passes browser arguments | now (S024) |
|
||||
| `python tools/icons.py` | rebuilds the icon font subset and `src/ui/icons.rs` from `tools/icons.txt` (needs fontTools and Arch's ttf-material-symbols-variable) | now (S015) |
|
||||
| `tools/engine-test/run.sh servo\|chromium\|webkit` + `analyze.py` | engine comparison: one browser visible on DP-1, throwaway profile, sites from `sites.txt`, per-second RAM (PSS), CPU, GPU of the whole process tree into `docs/engine/runs/<engine>/samples.csv`; `webkit_shell.py` is the WebKitGTK 6.0 shell (needs `webkitgtk-6.0`); report `docs/engine/engine-comparison.md`. Never run two at once or alongside cargo | now |
|
||||
| `tools/smoke.sh tests/smoke/pip.txt`, `python3 tests/smoke/net/server.py &` + `SMOKE_SIZE=1280x900 tools/smoke.sh tests/smoke/auth.txt`, `tests/smoke/visible-ui.txt` (by hand, header) | PiP moves the live view and back (offline); HTTP sign-in cancel + saved login (offline); visible: portal file chooser, notification, page full screen, Web Inspector (`dialogs.txt` now also checks dialog answers, context menu, leave page, permission bars, notifications count) | now (S048) |
|
||||
| `tools/smoke.sh tests/smoke/pip.txt` (+ `tools/hidden.sh tests/smoke/pip.txt <out> -- tests/smoke/pip-driver.sh`: `<out>/windows.json` PiP floating), `bindings.txt` (side buttons, middle click; hidden only), `ctxmenu.txt` (site menu vs Nacre's; hidden only), `python3 tests/smoke/net/server.py &` + `SMOKE_SIZE=1280x900 tools/smoke.sh tests/smoke/auth.txt`, `tests/smoke/visible-ui.txt` (by hand, header) | PiP moves the live view and back (offline); HTTP sign-in cancel + saved login (offline); visible: portal file chooser, notification, page full screen, Web Inspector (`dialogs.txt` now also checks dialog answers, context menu, leave page, permission bars, notifications count) | now (S048, S056) |
|
||||
| `tools/hidden.sh <script> [outdir] [-- driver.sh]` | WebKit build hidden with a driver script: Xvfb → nested niri (`tools/nested-session.sh`), throwaway home, software GL, `NACRE_SCRIPT`; the driver gets `click`/`scroll` (`tools/wl-input`), `grab` (grim), `key`/`type` (wtype). Scripts in `tests/hidden/` (`basic.txt` offline; `web.txt` + `web-driver.sh` needs internet). Read the PNGs | now (S045) |
|
||||
| appimagetool, wine + Inno Setup, VM "Windows 10" | packaging and Windows checks | see the user's global CLAUDE.md "Building" |
|
||||
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ User's report (screenshots in the orchestrator session):
|
|||
|
||||
## Steps
|
||||
- [ ] Freeze: reproduce (visible: play a video, PiP, focus another window ~1 min, come back; also hidden: unmap/map, occlusion) with logs of the egui render/idle pump and frame clock; fix the cause; regression smoke if reproducible hidden.
|
||||
- [ ] Side buttons 8/9 → back/forward over web views and chrome; audit every binding from keys.rs and the Servo-era mouse handling against WebKit views; list results in PROGRESS.
|
||||
- [x] Side buttons 8/9 → back/forward over web views and chrome; audit every binding from keys.rs and the Servo-era mouse handling against WebKit views; list results in PROGRESS.
|
||||
- [x] Real PiP: video only, aspect-ratio window, remembered size/position, floating on niri without user config (parent or equivalent), own app-id; return restores the page state without reload.
|
||||
- [x] PiP controls restyled to the Material tokens/widgets, hover-shown; dark and light shots read.
|
||||
- [ ] Context menu: site-handled `contextmenu` shows only the site's menu; Nacre's otherwise. Smoke page with both cases.
|
||||
- [x] Context menu: site-handled `contextmenu` shows only the site's menu; Nacre's otherwise. Smoke page with both cases.
|
||||
- [x] Spelling underline position/clip in egui text fields fixed; shot read.
|
||||
- [ ] Visible run on DP-1 of all the above (shots read), hidden smokes green (launch, basics, input, keys, pip).
|
||||
- [x] Visible run on DP-1 of all the above (shots read), hidden smokes green (launch, basics, input, keys, pip).
|
||||
- [ ] PROGRESS entry, INDEX line, tracker, commit `S056: …`, push.
|
||||
|
||||
## End criteria
|
||||
|
|
|
|||
|
|
@ -411,6 +411,17 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor
|
|||
- Rerun fixes: input.txt first click waits (arrives >0.5 s hidden); auth.txt needs `SMOKE_SIZE=1280x900` (header now says so).
|
||||
- Not done: `blob:` downloads don't ask where to save and can't pause; no visible run; net-real.txt (internet) not run.
|
||||
|
||||
## S056 — Daily-use fixes from the user's first WebKit test (2026-11-13)
|
||||
- PiP: only the video now (page script gives it a fill style, its parent goes full screen; the browser keeps that full screen inside the PiP window, and the page leaving it ends PiP). Not the `<video>` itself: WebKit's video full screen stops playback in a GTK host (main window too). Window 480 px wide (remembered `window.pip_width`) × the video's aspect; floats on niri as a transient child of the browser window, app id `dev.nacre.Nacre.Pip` (gdk_wayland_toplevel_set_application_id on map). Position: Wayland clients can't place windows, so niri decides.
|
||||
- PiP controls: a surface pill with Material icon buttons round the big play button, mute shows its state, fades with hover; main window shows an empty state with "Bring it back".
|
||||
- Bindings audit on WebKit: shortcuts (keys.txt) ok; wheel, right click, typing on the page (input.txt) ok; side buttons 8/9 did nothing → window capture gesture runs back/forward over page and chrome (bindings.txt); middle click on a link loaded it in the same tab → new background tab, also for target=_blank, Ctrl+click same path, Ctrl+Shift in front (Ctrl not testable: wl-input can't hold keys); Ctrl+wheel zoom and middle click on a tab: code checked, not run.
|
||||
- Context menu: Nacre's menu only comes from WebKit's `context-menu` signal, which a cancelled `contextmenu` stops (ctxmenu.txt: site box → site menu only, plain text → Nacre's). On YouTube one right click gives no Nacre menu (hidden run); YouTube passes a second right click on purpose (as in Chrome) — asked the orchestrator whether that was the user's case.
|
||||
- Spelling: the red line was the page-side mirror (not egui): now position:fixed at the field's viewport box, border-box, an input's line box = its content height (integ-spell.txt: offset, transformed box with a tall input).
|
||||
- Freeze: not reproduced: hidden (focus away, workspace switch) and 3 visible DP-1 runs (local video and YouTube in PiP, 60–90 s away, workspace switch): frames kept drawing, chrome and page answered. The Gdk `gdk_frame_timings_presented` warning is GTK 4.23+ debug noise. Added a watchdog: `egui area: not drawing (…)` on stderr when a focused window's repaint waits > 3 s or the app stays busy, with frame-clock state, then `drawing again`.
|
||||
- Verified: build, `cargo test` 79 + webext 1; hidden smokes exit 0: launch, basics, input, keys, chrome, bindings, ctxmenu, pip (+ driver: is_floating true, 480×270), integ-spell; visible: pip, YouTube PiP (video only, plays, returns without reload), freeze scenario ×3. Shots read.
|
||||
- Not done: freeze cause unknown (needs the watchdog line from the user's next freeze); context-menu YouTube case waits for the answer.
|
||||
- Later: `log::` calls print nothing (no logger set up); Ctrl+click/Ctrl+wheel need a key-holding test helper.
|
||||
|
||||
## Later
|
||||
- A link followed inside a frame still goes through the tab's navigation policy (WebKit's GTK API has no frame info; S050).
|
||||
- file:// media outside the XDG user folders doesn't play (WebKit sandbox, D-043).
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ mod imp {
|
|||
pub last: RefCell<Option<(Vec<egui::ClippedPrimitive>, f32)>>,
|
||||
/// Whether the app can't draw right now (it is in the middle of something that made GTK paint).
|
||||
pub busy: RefCell<Option<Box<dyn Fn() -> bool>>>,
|
||||
/// The oldest repaint asked for and not drawn yet, and since when the app has been busy at each render (stall
|
||||
/// watchdog, S056).
|
||||
pub asked: Cell<Option<Instant>>,
|
||||
pub busy_since: Cell<Option<Instant>>,
|
||||
pub stall_logged: Cell<bool>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
@ -127,6 +132,7 @@ mod imp {
|
|||
let size = [(w * scale) as u32, (h * scale) as u32];
|
||||
let busy = self.app_busy();
|
||||
if busy {
|
||||
self.busy_since.set(Some(self.busy_since.get().unwrap_or_else(Instant::now)));
|
||||
// Show the last frame again and come back for a real one.
|
||||
let weak = obj.downgrade();
|
||||
glib::idle_add_local_once(move || {
|
||||
|
|
@ -141,6 +147,11 @@ mod imp {
|
|||
}
|
||||
return glib::Propagation::Stop;
|
||||
}
|
||||
self.busy_since.set(None);
|
||||
self.asked.set(None);
|
||||
if self.stall_logged.replace(false) {
|
||||
eprintln!("egui area: drawing again");
|
||||
}
|
||||
let mut page = self.page.get();
|
||||
let out = {
|
||||
let Ok(mut ui_fn) = self.ui.try_borrow_mut() else { return glib::Propagation::Stop };
|
||||
|
|
@ -288,9 +299,33 @@ impl EguiArea {
|
|||
});
|
||||
});
|
||||
a.attach_input();
|
||||
a.watch_stalls();
|
||||
a
|
||||
}
|
||||
|
||||
/// Logs once when the interface stops drawing: a repaint asked for long ago that GTK never ran (frame clock),
|
||||
/// or the app busy at every render. For the freeze the user saw (S056) that couldn't be reproduced here.
|
||||
fn watch_stalls(&self) {
|
||||
let weak = self.downgrade();
|
||||
glib::timeout_add_seconds_local(2, move || {
|
||||
let Some(a) = weak.upgrade() else { return glib::ControlFlow::Break };
|
||||
let imp = a.imp();
|
||||
let late = |t: Option<Instant>| t.is_some_and(|t| t.elapsed() > Duration::from_secs(3));
|
||||
// Only while the window has the keyboard: a window on another workspace rightly gets no frames.
|
||||
if !imp.stall_logged.get() && imp.window_focused.get() && a.is_mapped() && (late(imp.asked.get()) || late(imp.busy_since.get())) {
|
||||
imp.stall_logged.set(true);
|
||||
let clock = a.frame_clock().map(|c| format!("frame clock at {} µs, frame {}", c.frame_time(), c.frame_counter()));
|
||||
eprintln!(
|
||||
"egui area: not drawing (repaint asked {:?} ago, app busy for {:?}, {})",
|
||||
imp.asked.get().map(|t| t.elapsed()),
|
||||
imp.busy_since.get().map(|t| t.elapsed()),
|
||||
clock.unwrap_or_else(|| "no frame clock".into())
|
||||
);
|
||||
}
|
||||
glib::ControlFlow::Continue
|
||||
});
|
||||
}
|
||||
|
||||
pub fn forget(window: u64) {
|
||||
AREAS.with(|m| m.borrow_mut().remove(&window));
|
||||
}
|
||||
|
|
@ -318,6 +353,8 @@ impl EguiArea {
|
|||
}
|
||||
|
||||
pub fn repaint(&self) {
|
||||
let imp = self.imp();
|
||||
imp.asked.set(Some(imp.asked.get().unwrap_or_else(Instant::now)));
|
||||
if self.imp().rendering.get() {
|
||||
self.imp().repaint_again.set(true);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue