Make wxWebViewEdge visible after creating

Fixes: #18851
This commit is contained in:
PB
2021-02-07 21:28:50 +01:00
committed by Tobias Taschner
parent 414f211b8a
commit 623e6a4fc3
2 changed files with 1 additions and 11 deletions

View File

@@ -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);

View File

@@ -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)