Skip to content

fix: report renderer hangs independently of system sleep and window visibility - #53760

Merged
MarshallOfSound merged 2 commits into
45-x-yfrom
trop/45-x-y-bp-fix-report-renderer-hangs-independently-of-system-sleep-and-window-visibility-1788940770405
Sep 9, 2026
Merged

MarshallOfSound merged 2 commits into
45-x-yfrom
trop/45-x-y-bp-fix-report-renderer-hangs-independently-of-system-sleep-and-window-visibility-1788940770405

Conversation

@trop

@trop trop Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Backport of #53529

See that PR for details.

Notes: Fixed webContents emitting unresponsive right after the system wakes from sleep on Windows, and emitting responsive when a hung window was hidden rather than when it recovered.

…isibility (#53529)

* fix: don't report a renderer unresponsive right after the system wakes

The input event ack timeout that drives the `unresponsive` event runs on
base::TimeTicks, which keeps counting through system sleep on Windows
(QPC) but stands still on macOS and Linux. A timeout armed before the
machine sleeps therefore fires the moment it wakes, while every process
is still paging back in, and the renderer is reported unresponsive
(RenderWidgetHostImpl::OnInputEventAckTimeout -> RendererUnresponsive);
apps commonly answer that by killing and reloading the renderer. The GPU
watchdog already pauses across suspend for the same reason
(GpuWatchdogThread is a PowerSuspendObserver); the renderer hang monitor
has no power awareness.

WebContents::RendererUnresponsive() now checks base::PowerMonitor: when
the system is suspended, or resumed less than input::kHungRendererDelay
ago, it runs the hang monitor restarter it is handed instead of emitting
the event, so a renderer that is still stuck a full delay after the wake
is reported as before. The testing binding gains simulatePowerEvent() so
the spec can drive base::PowerMonitor's suspend/resume.

* fix: don't emit responsive when a hung renderer's window is hidden

RenderWidgetHostImpl::WasHidden() stopped the hang monitor with
StopInputEventAckTimeout(), which also declares the renderer responsive.
A window that hangs and is then minimized, occluded or screen-locked
therefore emitted `responsive` without recovering, and the real recovery
later emitted nothing, so neither event could be trusted. Hiding now
pauses the timeout instead (folded into
refactor_unfilter_unresponsive_events.patch, which exists to make these
events usable from Electron); showing the window re-arms it and a real
input ack still emits `responsive`.

* chore: update patches

* chore: reference upstream CL in patch description

Co-authored-by: Shelley Vohr <[email protected]>
@trop
trop Bot requested a review from a team as a code owner September 9, 2026 07:59
@trop
trop Bot requested a review from codebytere September 9, 2026 07:59
@trop trop Bot added 45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Sep 9, 2026
@MarshallOfSound
MarshallOfSound merged commit 3c94273 into 45-x-y Sep 9, 2026
81 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/45-x-y-bp-fix-report-renderer-hangs-independently-of-system-sleep-and-window-visibility-1788940770405 branch September 9, 2026 21:45
@release-clerk

release-clerk Bot commented Sep 9, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed webContents emitting unresponsive right after the system wakes from sleep on Windows, and emitting responsive when a hung window was hidden rather than when it recovered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants