diff --git a/include/wx/msw/webview_edge.h b/include/wx/msw/webview_edge.h index be7eeeac2a..b36fe61324 100644 --- a/include/wx/msw/webview_edge.h +++ b/include/wx/msw/webview_edge.h @@ -105,8 +105,6 @@ private: void OnSize(wxSizeEvent& event); - void OnShow(wxShowEvent& event); - bool RunScriptSync(const wxString& javascript, wxString* output = NULL) const; wxDECLARE_DYNAMIC_CLASS(wxWebViewEdge); diff --git a/src/msw/webview_edge.cpp b/src/msw/webview_edge.cpp index 06b1f1126a..dc52b28ead 100644 --- a/src/msw/webview_edge.cpp +++ b/src/msw/webview_edge.cpp @@ -296,6 +296,7 @@ HRESULT wxWebViewEdgeImpl::OnWebViewCreated(HRESULT result, ICoreWebView2Control m_initialized = true; UpdateBounds(); + m_webViewController->put_IsVisible(true); // Connect and handle the various WebView events m_webView->add_NavigationStarting( @@ -362,7 +363,6 @@ ICoreWebView2Settings* wxWebViewEdgeImpl::GetSettings() wxWebViewEdge::~wxWebViewEdge() { - Unbind(wxEVT_SHOW, &wxWebViewEdge::OnShow, this); delete m_impl; } @@ -387,7 +387,6 @@ bool wxWebViewEdge::Create(wxWindow* parent, if (!m_impl->Create()) return false; Bind(wxEVT_SIZE, &wxWebViewEdge::OnSize, this); - Bind(wxEVT_SHOW, &wxWebViewEdge::OnShow, this); LoadURL(url); return true; @@ -399,13 +398,6 @@ void wxWebViewEdge::OnSize(wxSizeEvent& event) event.Skip(); } -void wxWebViewEdge::OnShow(wxShowEvent& event) -{ - if (m_impl->m_webView) - m_impl->m_webViewController->put_IsVisible(event.IsShown()); - event.Skip(); -} - void wxWebViewEdge::LoadURL(const wxString& url) { if (!m_impl->m_webView)