Skip to content

fix: paint and flash issues on macOS - #46615

Merged
codebytere merged 2 commits into
mainfrom
fix-flash
Apr 14, 2025
Merged

codebytere merged 2 commits into
mainfrom
fix-flash

Conversation

@codebytere

Copy link
Copy Markdown
Member

Description of Change

Partially addresses #32001
Closes #46602
Refs #44628.

Fixes two related issues following the transition away from InspectableWebContentsViewMac on macOS. The compositor was unsuspended correctly if the window isn't immediately shown but

  1. No paint was scheduled
  2. The compositor layer wasn't made visible

which led to paints not being correctly occurring and a white flash as the paint occurred only after visibility change.

cc @michal-pichlinski-openfin

Checklist

Release Notes

Notes: Fixed several paint and white flash issues on macOS.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/35-x-y PR should also be added to the "35-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. labels Apr 11, 2025
@codebytere
codebytere requested a review from a team as a code owner April 11, 2025 14:07
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 11, 2025
+ layer()->SetVisible(is_visible_ || is_headless_mode_window_);
if (is_visible_ || is_headless_mode_window_) {
compositor_->Unsuspend();
+ layer()->SchedulePaint(layer()->bounds());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does upstream headless mode suffer from paint not being scheduled ? Wondering if this part of the patch can be upstreamed ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepak1556 i'm not sure - I can check into it!

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Apr 12, 2025
@codebytere
codebytere merged commit 51bffb5 into main Apr 14, 2025
@codebytere
codebytere deleted the fix-flash branch April 14, 2025 14:29
@release-clerk

release-clerk Bot commented Apr 14, 2025

Copy link
Copy Markdown

Release Notes Persisted

Fixed several paint and white flash issues on macOS.

@trop

trop Bot commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "35-x-y", please check out #46628

@trop

trop Bot commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "36-x-y", please check out #46629

@trop trop Bot added in-flight/36-x-y and removed target/35-x-y PR should also be added to the "35-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. labels Apr 14, 2025
ckerr pushed a commit that referenced this pull request Apr 14, 2025
* fix: paint and flash issues on macOS

* Adhere to paintWhenInitiallyHidden
ckerr pushed a commit that referenced this pull request Apr 14, 2025
* fix: paint and flash issues on macOS

* Adhere to paintWhenInitiallyHidden
ckerr pushed a commit that referenced this pull request Apr 14, 2025
* fix: paint and flash issues on macOS

* Adhere to paintWhenInitiallyHidden
@trop trop Bot added merged/36-x-y PR was merged to the "36-x-y" branch. and removed in-flight/36-x-y labels Apr 15, 2025
@trop trop Bot added merged/35-x-y PR was merged to the "35-x-y" branch. and removed in-flight/35-x-y labels Apr 15, 2025
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
* fix: paint and flash issues on macOS

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

Labels

merged/35-x-y PR was merged to the "35-x-y" branch. merged/36-x-y PR was merged to the "36-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initially hidden BrowserWindow with dark background flashes white background when shown

2 participants