[pull] dev from tauri-apps:dev - #408
Merged
Merged
Conversation
…15630) * fix(runtime-wry): query monitors on main thread from runtime handle WryHandle::primary_monitor, monitor_from_point and available_monitors read the event loop's window target directly on the calling thread. That window target is not thread safe, so calling these functions from a background thread races with the UI thread and can segfault or corrupt the heap. Route the three queries through the event loop like cursor_position already does, so the window target is only accessed on the main thread. Closes #15170 * refactor(runtime-wry): use event_loop_window_getter! for monitor queries Reuse the existing event_loop_window_getter! macro (as cursor_position does) instead of hand-rolling the channel + send_user_message boilerplate in primary_monitor, monitor_from_point and available_monitors. These methods return bare Option/Vec, so a small closure absorbs the macro's internal `?`. * Revert "refactor(runtime-wry): use event_loop_window_getter! for monitor queries" This reverts commit fc2078b. * fix(runtime-wry): return no monitors when event loop send fails If send_user_message errors the event loop will never reply, so recv() would block the calling thread forever. Return None / an empty Vec on a send error instead of waiting. * return results * fix mock --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> Co-authored-by: Tony <legendmastertony@gmail.com>
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )