Conversation
Pausing hid the browser, so resuming restarted the viz video capturer and Invalidate asked for a refresh frame. Both replay the last frame composited before the pause, and the capture oracle then delays the first real frame. Stale hover and layout state showed for a moment. Keep the browser visible and only stop feeding it begin frames. Pause and resume each send one begin frame so the texture holds the final page state while paused and updates right away on resume.
|
The issue still isn't fully fixed. It no longer flickers every time, but it still happens occasionally. On top of that, the second interface still loads with the old size when opened, which doesn't happen in 1.6. executeBrowserJavascript(browserElement, 'openWindow("addObject");');
setTimer(function()
executeBrowserJavascript(browserElement, 'setObjectEditorHeight('..(screenY * 0.95)..');');
end, 50, 1); |
A paused browser got no frames at all, so whatever a script changed right before or during the pause was only painted after resume, with the old frame showing first. Script changes now request two frames even while paused, so the texture is current when rendering resumes.
|
ok looked into it, it's just a small bug in the pause path. a paused browser got no frames at all, so the closeWindow and the mouse move you send right before pausing sometimes never got painted, and the old dialog was still sitting in the texture when you resumed. pushed a fix, a paused browser now gets a frame whenever a script touches it (js, resize, page load), so the texture is always current when you unpause. the size thing is a different story. your addObject window mounts at its default 750px and only grows when the 50ms timer runs setObjectEditorHeight, so there is a real 750px frame in between and now it gets painted. on 1.6 the first frame after WasHidden(false) showed up late enough that the timer had already run. easiest fix on your side is passing the height into openWindow. with this patch you can also open and resize it while still paused and unpause a frame or two later, the texture is already right by then. |
Summary
Pausing rendering hid the browser. When it is shown again CEF replays the last frame composited before the pause, once because the video capturer restarts and once more for the
Invalidatecall, and that stale frame lands on the texture before the real one.Paused browsers now stay visible and simply stop receiving begin frames. A script change (JS, resize, page load, the pause call itself) still gets two frames while paused, so the texture is always current when rendering resumes.
Fixes #5371
Test plan
Repro resource from #5371: start
vr_uiandcef_flicker, pressmrepeatedly. The dialog opens in its current state with no stale frame. Hover after resume still updates (#5154).Checklist