#54090: fix: keep hidden windows rendering when they navigate
Description of Change
Before: a BrowserWindow created with show: false could stop rendering as its page committed, so ready-to-show never fired and the window stayed invisible until something called show(). With a titleBarOverlay this started happening in 44.4.0 (nearly always on some Windows machines, intermittently elsewhere); calling webContents.setZoomFactor() on a hidden window before its first paint has triggered the same thing since 40.
After: hidden windows keep producing frames across navigations, so ready-to-show fires and requestAnimationFrame keeps running even if the overlay or zoom changes before the window is shown.
Electron keeps a hidden window's widget visible so it can paint, but RenderWidgetHostViewAura::DidNavigate only looked at the view, treated the widget as dormant and invalidated its LocalSurfaceId. Any VisualProperties push before the first frame was acked (the overlay rect posted from DidFinishNavigation since #53639, or a zoom change) then reached the renderer without a surface id, and it deferred all main frames until the window was shown.
How: disable_hidden.patch now keys that decision off the host's visibility as well, matching RenderWidgetHostViewMac; the other two patches only pick up new index lines. Adds specs that spawn a small app with a hidden overlay window, and that change the overlay from did-navigate on a hidden window and check frames keep coming. A hidden window's page now gets the overlay geometry with its first visual properties (as a shown window's already could), so the existing overlay specs poll navigator.windowControlsOverlay.visible instead of waiting for an initial geometrychange.
Fixes #54025.
Fixes #51972.
Refs #42409.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
- tests are changed or added
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, past tense, and no longer than 80 characters.
Release Notes
Notes: Fixed ready-to-show never firing for some hidden windows on Windows and Linux.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron