Set cef messageloop running inside wxWebviewChromium instead of client

side.
This commit is contained in:
Haojian Wu 2014-06-09 17:53:18 +08:00 committed by Tobias Taschner
parent 49f183ce41
commit d51a8d20f7
No known key found for this signature in database
GPG key ID: AE6ECD71294F87FD
3 changed files with 5 additions and 9 deletions

View file

@ -221,7 +221,7 @@ public:
// If using a separate subprocess then return the result of this function
static int StartUpSubprocess();
static void Shutdown();
static void RunMessageLoopOnce();
static void RunCEFMessageLoopOnIdle(wxIdleEvent& event);
protected:
virtual void DoSetPage(const wxString& html, const wxString& baseUrl);

View file

@ -72,7 +72,7 @@ public:
virtual bool OnInit();
virtual int OnExit();
virtual bool ProcessIdle();
/*
#if wxUSE_CMDLINE_PARSER
virtual void OnInitCmdLine(wxCmdLineParser& parser)
@ -150,6 +150,7 @@ public:
void OnFindOptions(wxCommandEvent& evt);
void OnEnableContextMenu(wxCommandEvent& evt);
private:
wxTextCtrl* m_url;
wxWebView* m_browser;
@ -266,11 +267,6 @@ int WebApp::OnExit()
return wxApp::OnExit();
}
bool WebApp::ProcessIdle() {
wxWebViewChromium::RunMessageLoopOnce();
return wxApp::ProcessIdle();
}
WebFrame::WebFrame(const wxString& url) :
wxFrame(NULL, wxID_ANY, "wxWebView Sample")
{

View file

@ -111,7 +111,7 @@ bool wxWebViewChromium::Create(wxWindow* parent,
gtk_widget_show_all(GTK_WIDGET(window));
#endif
this->Bind(wxEVT_SIZE, &wxWebViewChromium::OnSize, this);
this->Bind(wxEVT_IDLE, &wxWebViewChromium::RunCEFMessageLoopOnIdle);
return true;
}
@ -457,7 +457,7 @@ int wxWebViewChromium::StartUpSubprocess()
return CefExecuteProcess(args, NULL);
}
void wxWebViewChromium::RunMessageLoopOnce()
void wxWebViewChromium::RunCEFMessageLoopOnIdle(wxIdleEvent& event)
{
CefDoMessageLoopWork();
}