electron/shell
Samuel Attard 3fa5280fde
fix: re-enable MacWebContentsOcclusion with embedder window fix (#50715)
fix: re-enable MacWebContentsOcclusion with embedder window fix (#50579)

* fix: re-enable MacWebContentsOcclusion with embedder window fix

Replace the full revert of Chromium's MacWebContentsOcclusion cleanup
with a targeted patch that handles embedder windows shown after
WebContentsViewCocoa attachment. This lets us drop the feature flag
disable in feature_list.cc and re-enable upstream occlusion tracking.

Adds tests for show/hide event counts on macOS and visibility tracking
across multiple child WebContentsViews.

* test: drop show/hide event count assertion

The assertion that 'show' fires exactly once per w.show() call is not
an API guarantee - macOS can send multiple occlusion state
notifications during a single show() when other windows are on screen
(common on CI after hundreds of prior tests). The
visibilitychange-count test in api-web-contents-view-spec.ts covers
the actual invariant we care about.

* fix: ignore WebContentsOcclusionCheckerMac synthetic notifications in window delegate

On macOS 13.3-25.x, Chromium's occlusion checker enables manual
frame-intersection detection and posts synthetic
NSWindowDidChangeOcclusionStateNotification tagged with its class name
in userInfo. These fire when the checker's NSContainsRect heuristic
decides a window is covered by another window's frame, but the real
-[NSWindow occlusionState] hasn't changed.

Our delegate was treating these the same as real macOS notifications
and emitting show/hide events based on occlusionState, which was
unchanged - resulting in spurious duplicate show events when e.g.
Quick Look opened and its frame intersected the BrowserWindow.
2026-04-06 16:01:41 -04:00
..
app chore: bump chromium to 146.0.7666.0 (41-x-y) (#49543) 2026-02-17 16:19:16 -05:00
browser fix: re-enable MacWebContentsOcclusion with embedder window fix (#50715) 2026-04-06 16:01:41 -04:00
common fix: defer Wrappable destruction in SecondWeakCallback to a posted task (#50694) 2026-04-05 09:49:43 +00:00
renderer feat: make Chrome extensions work on custom protocols (#50529) 2026-04-02 20:09:56 -07:00
services/node feat: enable WASM trap handlers in all Node.js processes (#49839) 2026-02-18 13:22:36 -05:00
utility fix: broken OOP window.print() on macOS/Linux (#45214) 2025-01-20 10:23:44 +01:00