Skip to content

revert: add BrowserWindow.isOccluded() - #41311

Merged
codebytere merged 1 commit into
mainfrom
revert-768ece6
Feb 12, 2024
Merged

codebytere merged 1 commit into
mainfrom
revert-768ece6

Conversation

@codebytere

@codebytere codebytere commented Feb 11, 2024 •

Copy link
Copy Markdown
Member

Description of Change

Closes #41295

Revert #38982 - it looks like there were missed failures on WOA. I'm working to debug but in the meantime we can revert to clear up CI depending how much progress I make.

Checklist

Release Notes

Notes: none

@codebytere
codebytere requested a review from a team February 11, 2024 21:55
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Feb 11, 2024
@codebytere codebytere added semver/patch backwards-compatible bug fixes no-backport labels Feb 12, 2024
@codebytere
codebytere merged commit 5f785f2 into main Feb 12, 2024
@codebytere
codebytere deleted the revert-768ece6 branch February 12, 2024 08:35
@release-clerk

release-clerk Bot commented Feb 12, 2024

Copy link
Copy Markdown

No Release Notes

jstradej pushed a commit to jstradej/strideterm that referenced this pull request Aug 12, 2026
A renderer CPU profile captured while the app sat idle overnight showed
the main thread 27.6% busy with essentially no JavaScript — 5 samples
out of 10790. The work arrived in bursts 16.6ms apart, one per vsync at
60Hz, which is the signature of CSS animations forcing style and paint
instead of riding the compositor.

Three infinite animations drove properties that cannot be composited:
the two box-shadow pulses on active Task Dashboard pipeline steps and
round chips, and the background-position shimmer on the Docker disk
usage skeleton. Each is now a pseudo-element animating opacity or
transform, which the compositor handles off the main thread. The glow
carries pointer-events: none so the round chips stay clickable.

Animations are additionally frozen outright while the window isn't
being looked at, via html.app-hidden and animation-play-state. The
!important there is load-bearing: the `animation` shorthand every
animated rule uses resets play-state to `running`, at higher
specificity than the freeze.

Driving that class needs main-process help. Our windows disable
backgroundThrottling so the xterm WebGL renderer doesn't stall
mid-scroll (408220d), and Electron pins document.visibilityState to
"visible" whenever that flag is off — visibilitychange never fires, so
the renderer cannot observe that it stopped being watched. main now
pushes minimize/hide/restore/show over window:visibility, while the
remote/mobile client keeps using visibilitychange, which works there.
Whichever input reports hidden wins.

A window merely covered by other windows is still not detected.
Chromium tracks native occlusion internally but exposes no API for it:
BrowserWindow.isOccluded() was reverted five days after landing
(electron/electron#41311) and is absent from Electron 43.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-pr 🌱 PR opened recently no-backport semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

electron-woa-testing consistently failing in BrowserWindow.isOccluded() test

2 participants