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

@@ -52,7 +52,6 @@ public:
MessageHandler on_message,
CloseHandler on_close,
CloseHandler on_destroyed);
static void show_modeless_dialog(PluginWebDialog* dialog);
static void post_message(PluginWebDialog* dialog, const nlohmann::json& data);
static void request_close(PluginWebDialog* dialog);