Skip to content

fix(runtime-wry): propagate wry file drop event to tao event loop, closes #8206#8393

Merged
lucasfernog merged 4 commits intodevfrom
fix/runtime-wry/propagate-file-drop-event
Dec 28, 2023
Merged

fix(runtime-wry): propagate wry file drop event to tao event loop, closes #8206#8393
lucasfernog merged 4 commits intodevfrom
fix/runtime-wry/propagate-file-drop-event

Conversation

@amrbashir
Copy link
Copy Markdown
Member

@amrbashir amrbashir commented Dec 14, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@amrbashir amrbashir requested a review from a team as a code owner December 14, 2023 02:31
@amrbashir amrbashir changed the title fix(runtime-wry): propagate wry file drop event to tao event loop fix(runtime-wry): propagate wry file drop event to tao event loop, closes #8206 Dec 14, 2023
@amrbashir amrbashir linked an issue Dec 14, 2023 that may be closed by this pull request
Comment thread core/tauri-runtime-wry/src/lib.rs Outdated
window_id,
WebviewMessage::WebviewEvent(WebviewEvent::FileDrop(event)),
));
let has_listeners = !window_event_listeners.lock().unwrap().is_empty();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should always return true now, we can't know for sure if the event was handled or not (that was the case with the previous implementation too - which is also wrong on v1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless... we add a new API (I'll take a look)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An API would be nicer indeed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I suspected we can't really determine this unless we create a closure just to handle the file drop event, and remove it from the event loop event enum. yikes. I think we should always block the default OS behavior instead.

Comment thread .changes/runevent-filedrop.md Outdated
@lucasfernog lucasfernog merged commit cb640c8 into dev Dec 28, 2023
@lucasfernog lucasfernog deleted the fix/runtime-wry/propagate-file-drop-event branch December 28, 2023 13:20
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.

[bug] v2 file-drop doesn't trigger drop event listener in fs plugin

2 participants