Create plugin windows off the webview callback stack

wx 3.3.2 delivers webview script messages synchronously inside the native
callback on GTK and macOS, so script plugins run with the plugins-dialog
webview's signal/delegate frame on the stack. Creating and presenting the
orca.host.ui window from there crashed on Linux at Raise() --
gtk_window_present while GTK's deferred show was still in flight.

Defer the whole window creation to a CallAfter with a pre-bound registry
handle (post/close stay FIFO-safe, teardown races become a no-op), and
drop Raise() plus the show_modeless_dialog wrapper: Show() already
activates and fronts a new window on every platform.
This commit is contained in:
SoftFever
2026-07-16 20:07:41 +08:00
parent 49396699e7
commit b779a7bfed
3 changed files with 31 additions and 14 deletions

View File

@@ -163,14 +163,6 @@ PluginWebDialog* PluginWebDialog::create_modeless_dialog(wxWindow* parent,
std::move(on_destroyed));
}
void PluginWebDialog::show_modeless_dialog(PluginWebDialog* dialog)
{
if (dialog == nullptr)
return;
dialog->Show();
dialog->Raise();
}
void PluginWebDialog::post_message(PluginWebDialog* dialog, const nlohmann::json& data)
{
if (dialog != nullptr && dialog->is_open())