-
-
Notifications
You must be signed in to change notification settings - Fork 281
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(linux): async custom protocol crashing sending response #1276
Conversation
src/webkitgtk/web_context.rs
Outdated
if let Some(content_type) = content_type { | ||
response.set_content_type(content_type); | ||
} | ||
gtk::glib::idle_add(move || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use MainContext::invoke
instead? seems like idle_add
might wait until the loop is idle which may impact performance, also MainContext::invoke
will call the closure directly if it is already on the main thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i'll try that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted @amrbashir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i knew that function existed - just couldn't find it in tao/wry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted @amrbashir
did you forget to push 😂?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣🤣🤣🤣 in my defense i was testing this while holding a baby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries, anything for the baby ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finally pushed
Fixes
GTK may only be used from the main thread. thread 'tokio-runtime-worker' panicked at .cargo/registry/src/index.crates.io-6f17d22bba15001f/webkit2gtk-2.0.1/src/auto/uri_scheme_response.rs:26
Ref tauri-apps/tauri#9794