Skip to content
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

fix: use default NSVisualEffectState enum case #24471

Merged
merged 1 commit into from
Jul 13, 2020
Merged

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Jul 9, 2020

Description of Change

Closes #16417.

In Apple documentation NSVisualEffectState is an enum with three options detailing how the material appearance should reflect window activity state. We were previously using NSVisualEffectStateActive, meaning that the backdrop would always appear active. This breaks from the default as specified in the first link, which is NSVisualEffectStateFollowsWindowActiveState and means that the backdrop should automatically appear active when the window is active, and inactive when it is not. This thus changes our effect state to the more expected default.

cc @miniak @zcbenz @jkleinsc

Checklist

Release Notes

Notes: Fixed an issue where macOS window vibrancy active state did not always match the active state of the window.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jul 9, 2020
@MarshallOfSound
Copy link
Member

Notes: Fixed an issue where the effect state on macOS was not using the appropriate default for NSVisualEffectState.

I had to do some googling to figure this out, can we phrase this better in a way Electron devs would understand what changed. i.e. does this only impacts folks using vibrancy?

@codebytere
Copy link
Member Author

@MarshallOfSound yes - it's invoked in SetVibrancy. Honestly not sure how to distill this down any better, since it is a detail that's somewhat specific to macOS-specific APIs.

@MarshallOfSound
Copy link
Member

I assume this is a visual change, what will users see differently now?

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jul 10, 2020
@codebytere
Copy link
Member Author

codebytere commented Jul 13, 2020

@MarshallOfSound essentially - the vibrancy active state did not match that of the window. The default behavior of native macOS apps with vibrancy is to disable the vibrancy when the window is inactive, which makes it easier for the user to see the active app. Before this fix we forced it to be active all the time, which was visually confusing.

Updated the notes to:

Fixed an issue where macOS window vibrancy active state did not always match the active state of the window.

which i think should provide more clarity.

@codebytere codebytere merged commit f0a0e10 into master Jul 13, 2020
@release-clerk
Copy link

release-clerk bot commented Jul 13, 2020

Release Notes Persisted

Fixed an issue where macOS window vibrancy active state did not always match the active state of the window.

@codebytere codebytere deleted the use-default-effect branch July 13, 2020 19:40
@trop
Copy link
Contributor

trop bot commented Jul 13, 2020

I was unable to backport this PR to "8-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jul 13, 2020

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

@trop
Copy link
Contributor

trop bot commented Jul 13, 2020

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

georgexu99 pushed a commit to georgexu99/electron that referenced this pull request Jul 13, 2020
@trop
Copy link
Contributor

trop bot commented Jul 14, 2020

@codebytere has manually backported this PR to "8-x-y", please check out #24546

sentialx pushed a commit to sentialx/electron that referenced this pull request Jul 30, 2020
@greenimpala
Copy link

greenimpala commented Aug 21, 2020

I understand the reasoning behind this change but can we not provide the facility to force vibrancy regardless of window state? I would like to keep the vibrancy when the window is not active.

@codebytere
Copy link
Member Author

@greenimpala seems like a reasonable BrowserWindow option - happy to try and add it.

@codebytere
Copy link
Member Author

@greenimpala popped up a fast PR, linked above

@greenimpala
Copy link

@codebytere Great work, looks good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vibrancy should not default to active state
4 participants