Skip to content

fix: vibrancy window border #46648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged

Conversation

clavin
Copy link
Member

@clavin clavin commented Apr 16, 2025

Description of Change

Chromium sets some properties on NSWindow when we initialize a widget with support for translucency (added in #46392). This causes undesirable visual effects, such as the loss of the window border (see #46586).

The easiest fix is to patch out the unintended Chromium code. We set both properties ourselves when appropriate.

Fixes #46586
Ref: #46392

Checklist

Release Notes

Notes: Fixed the border style of windows with vibrancy on macOS.

@clavin clavin 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 16, 2025
@clavin clavin requested a review from a team as a code owner April 16, 2025 03:39
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Apr 16, 2025
@clavin
Copy link
Member Author

clavin commented Apr 16, 2025

Worth mentioning there's an alternate solution using WidgetDelegate::OnWidgetInitialized to undo what is done by the Chromium code in this patch. It would let us avoid the patch, but we'd still have an invisible "dependency" on this Chromium code and the result would be a lot less clean.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Apr 17, 2025
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

@clavin personally i'd rather the non-patch route with appropriate commenting - our patches have been ballooning lately and there's no clear path for removal here. We can also try to talk to upstream about it.

@clavin
Copy link
Member Author

clavin commented Apr 24, 2025

Refactored this to use WidgetDelegate::OnWidgetInitialized as suggested by @codebytere. I think there may be a reasonable way to upstream this too, but I don't have the bandwidth atm to do it.

@codebytere codebytere merged commit 51dbe69 into main Apr 25, 2025
56 checks passed
@codebytere codebytere deleted the clavin/fix-window-vibrancy-border-mac branch April 25, 2025 09:42
@release-clerk
Copy link

release-clerk bot commented Apr 25, 2025

Release Notes Persisted

Fixed the border style of windows with vibrancy on macOS.

@trop
Copy link
Contributor

trop bot commented Apr 25, 2025

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

@trop trop bot added in-flight/36-x-y and removed target/36-x-y PR should also be added to the "36-x-y" branch. labels Apr 25, 2025
@trop
Copy link
Contributor

trop bot commented Apr 25, 2025

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

@trop trop bot added in-flight/35-x-y and removed target/35-x-y PR should also be added to the "35-x-y" branch. labels Apr 25, 2025
ckerr pushed a commit that referenced this pull request Apr 25, 2025
* fix: vibrancy window border

* Use WidgetDelegate::OnWidgetInitialized instead
ckerr pushed a commit that referenced this pull request Apr 25, 2025
* fix: vibrancy window border

* Use WidgetDelegate::OnWidgetInitialized instead
jkleinsc pushed a commit that referenced this pull request Apr 25, 2025
fix: vibrancy window border (#46648)

* fix: vibrancy window border

* Use WidgetDelegate::OnWidgetInitialized instead

Co-authored-by: Calvin <clavin@users.noreply.github.com>
@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 25, 2025
jkleinsc pushed a commit that referenced this pull request Apr 25, 2025
fix: vibrancy window border (#46648)

* fix: vibrancy window border

* Use WidgetDelegate::OnWidgetInitialized instead

Co-authored-by: Calvin <clavin@users.noreply.github.com>
@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 25, 2025
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.

Setting vibrancy removes window border style
3 participants