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: emit click events with tray context menu #24200

Merged
merged 1 commit into from Jun 22, 2020

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Jun 18, 2020

Description of Change

Closes #24196.

When a context menu is added to a Tray on macOS, the menu controller overrides the mouseUp handler, where click events were emitted. This fixes the issue by pulling click event handling into a separate function, and emitting click events on mouseDown when a menu controller has been set and normally on mouseUp otherwise.

Tested with https://gist.github.com/1ffed70969360d362c807d60fe692404.

cc @MarshallOfSound @nornagon @zcbenz

Checklist

Release Notes

Notes: Fixed an issue with click events not being emitted on macOS for Trays with context menus set.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 18, 2020
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 19, 2020
@codebytere codebytere merged commit 046a059 into master Jun 22, 2020
@release-clerk
Copy link

release-clerk bot commented Jun 22, 2020

Release Notes Persisted

Fixed an issue with click events not being emitted on macOS for Trays with context menus set.

@codebytere codebytere deleted the fix-click-events-with-context-menu branch June 22, 2020 15:24
@trop
Copy link
Contributor

trop bot commented Jun 22, 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 Jun 22, 2020

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

@trop
Copy link
Contributor

trop bot commented Jun 22, 2020

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

@trop
Copy link
Contributor

trop bot commented Jun 22, 2020

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

sentialx pushed a commit to sentialx/electron that referenced this pull request Jul 30, 2020
sentialx pushed a commit to sentialx/electron that referenced this pull request Apr 8, 2021
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.

Tray event click & double-click not working after setContextMenu on macOS
2 participants