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: macOS tray icon alternate images #33026

Merged
merged 1 commit into from Feb 28, 2022
Merged

fix: macOS tray icon alternate images #33026

merged 1 commit into from Feb 28, 2022

Conversation

codebytere
Copy link
Member

Description of Change

Closes #33008.

Fixes an issue where alternateImages did not work properly on macOS. To fix this, we need to change the button type when setting an alternate image because the default button type for NSStatusItem, NSStatusBarButton, does not display alternate content when clicked. NSButtonTypeMomentaryChange displays its alternate content when clicked and returns to its normal content when the user releases it, which is the behavior users would expect when clicking a button with an alternate image set. After this fix, the tray icon displays the same behavior as it did prior to this breaking. Also tested with context menus etc to ensure nothing else broke by changing this.

Checklist

Release Notes

Notes: Fixes an issue where alternateImages did not work properly on macOS.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/15-x-y labels Feb 21, 2022
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 21, 2022
@codebytere codebytere requested review from a team as code owners February 21, 2022 12:37
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 22, 2022
@he-jialin
Copy link

hi, haven't merged into the main branch yet?

@codebytere codebytere merged commit 283fa2b into main Feb 28, 2022
@codebytere codebytere deleted the fix-pressed-image branch February 28, 2022 22:59
@release-clerk
Copy link

release-clerk bot commented Feb 28, 2022

Release Notes Persisted

Fixes an issue where alternateImages did not work properly on macOS.

@trop
Copy link
Contributor

trop bot commented Feb 28, 2022

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

@trop
Copy link
Contributor

trop bot commented Feb 28, 2022

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

@trop
Copy link
Contributor

trop bot commented Feb 28, 2022

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

@trop
Copy link
Contributor

trop bot commented Feb 28, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: electron17 tray.setPressedImage invalid
3 participants