You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice catch, I believe all window events should use emit_filter and target, EventTarget::Any, EventTarget::Window and EventTarget::WebviewWindow
Thanks for the feedback @amrbashir, I've changed the emit_to to emit_filter.
However, I'm curious about your suggestions to use EventTarget::Any as well. Wouldn't Any already target the others inherently? This would also continue to send the close requested event to all windows...
Or did you just mean to say that all events should use emit_filter?
You're right, no need to target EventTarget::Any, I suggested that so the event would still trigger listeners from app.listen_any but it will be emitted to it anyway. For this PR, EventTarget::Window and EventTarget::WebviewWindow should be enough.
Ah, gotcha. So even if there is no matchingWindow or WebviewWindow the event should still be emitted internally for listen_any to catch, right? 257e95b
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
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.
When using the onCloseRequested JS Api, the event was triggered even when closing other windows, not just the one of interest.
I believe it would be more logical for this event to be dispatched exclusively for the current window's close requests.
Before:
before.mp4
After:
after.mp4