-
Notifications
You must be signed in to change notification settings - Fork 16.4k
fix: delay emitting NotifyIcon events on Windows #26668
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
zcbenz
merged 14 commits into
electron:master
from
erickzhao:erick/delay-notifyicon-events
Nov 30, 2020
Merged
fix: delay emitting NotifyIcon events on Windows #26668
zcbenz
merged 14 commits into
electron:master
from
erickzhao:erick/delay-notifyicon-events
Nov 30, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codebytere
approved these changes
Nov 24, 2020
nornagon
suggested changes
Nov 24, 2020
nornagon
reviewed
Nov 25, 2020
nornagon
reviewed
Nov 25, 2020
erickzhao
commented
Nov 25, 2020
nornagon
approved these changes
Nov 25, 2020
zcbenz
approved these changes
Nov 30, 2020
Release Notes Persisted
|
erickzhao
added a commit
to erickzhao/ericktron
that referenced
this pull request
Mar 10, 2021
* wip? * attempt to use weakptr * apply posttask change to other balloon events * chore: add clarifying comment on weakptr * refactor: move weakptr include to implementation (it's not needed in the header file) * refactor: use default initializer for weak factory * refactor: move weakptr usage outside of loop * fix: convert mouse events as well * refactor: use member function for balloon events * fix: check if wicon is truthy in callback * refactor: bind mouse events with member function * refactor: inline lparams * refactor: inline getkeyboardmodifiers() * chore: correct GetKeyboardModifiers typo
@erickzhao has manually backported this PR to "12-x-y", please check out #28111 |
zcbenz
pushed a commit
that referenced
this pull request
Mar 13, 2021
* wip? * attempt to use weakptr * apply posttask change to other balloon events * chore: add clarifying comment on weakptr * refactor: move weakptr include to implementation (it's not needed in the header file) * refactor: use default initializer for weak factory * refactor: move weakptr usage outside of loop * fix: convert mouse events as well * refactor: use member function for balloon events * fix: check if wicon is truthy in callback * refactor: bind mouse events with member function * refactor: inline lparams * refactor: inline getkeyboardmodifiers() * chore: correct GetKeyboardModifiers typo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Following prior work done in #25836, this PR delays emitting Balloon events from the
Tray
module to avoid entering V8 during a WndProc callback.Implementation Details
Since
TrayIcon
objects are deleted when theTray
gets garbage collected, we don't want the callback to be processed if the icon is gone. This PR usesWeakPtr
references to achieve this end.This also means that the affected events won't be emitted if the WndProc callback is entered, but the
TrayIcon
is destroyed. This behaviour seems in line with Electron's existingTray
API design, as a reference to theTray
needs to be maintained for its API to be used at all.cc @nornagon
Checklist
npm test
passesRelease Notes
Notes: Fixed a rare crash on Windows that could occur when emitting certain
Tray
events.