Skip to content

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 recently 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 recently label Feb 22, 2022
@codebytere codebytere requested a review from zcbenz February 23, 2022 09:09
@codebytere codebytere force-pushed the fix-pressed-image branch 2 times, most recently from a68ec28 to 9f14c40 Compare February 23, 2022 09:38
@he-jialin2
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

4 participants