Skip to content
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

Queue wxWebViewEdge events #22834

Closed
wants to merge 1 commit into from
Closed

Conversation

TcT2k
Copy link
Contributor

@TcT2k TcT2k commented Oct 1, 2022

Using HandleWindowEvent() from the WebView2 event callbacks is a common error source when user code does something blocking like RunScript() or ShowModal().

Queue the events to prevent this where possible, in wxEVT_WEBVIEW_NAVIGATING at least warn the developer instead of hanging silently.

Closes: #22744, #19075

Copy link
Contributor

@vadz vadz left a comment

Choose a reason for hiding this comment

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

Thanks, no real comments and I agree that this is the best thing to do.

I just think it would be better to avoid reentrancies even in release build, i.e. add a return there, but please let me know if you disagree.

src/msw/webview_edge.cpp Outdated Show resolved Hide resolved
src/msw/webview_edge.cpp Outdated Show resolved Hide resolved
Using HandleWindowEvent() from the WebView2 event callbacks
is a common error source when user code does something blocking
like RunScript() or ShowModal().
Queue the events to prevent this where possible, in
wxEVT_WEBVIEW_NAVIGATING at least warn the developer instead
of hanging silently.

Closes: wxWidgets#22744, wxWidgets#19075
Copy link
Contributor

@vadz vadz left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@vadz vadz closed this in 0ace989 Oct 4, 2022
@TcT2k TcT2k deleted the webview_edge_events branch October 6, 2022 07:27
TcT2k added a commit to TcT2k/wxWidgets that referenced this pull request Dec 8, 2022
Using HandleWindowEvent() from the WebView2 event callbacks
is a common error source when user code does something blocking
like RunScript() or ShowModal().
Queue the events to prevent this where possible, in
wxEVT_WEBVIEW_NAVIGATING at least warn the developer instead
of hanging silently.

Closes wxWidgets#22834, wxWidgets#22744, wxWidgets#19075

(cherry picked from commit 0ace989)
vadz pushed a commit that referenced this pull request Dec 10, 2022
Using HandleWindowEvent() from the WebView2 event callbacks
is a common error source when user code does something blocking
like RunScript() or ShowModal().
Queue the events to prevent this where possible, in
wxEVT_WEBVIEW_NAVIGATING at least warn the developer instead
of hanging silently.

See #22834, #22744, #19075

Closes #23025.

(cherry picked from commit 0ace989)
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.

Accessing HTML from wxWebViewEdge event handlers causes crash
2 participants