remove signal-blocking variable, instead just connect to signal when ready
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4c9bde5ec0
commit
7cf17ea27b
@ -115,10 +115,6 @@ public:
|
|||||||
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
|
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
|
||||||
virtual wxVector<wxSharedPtr<wxWebViewHandler> > GetHandlers() { return m_handlerList; }
|
virtual wxVector<wxSharedPtr<wxWebViewHandler> > GetHandlers() { return m_handlerList; }
|
||||||
|
|
||||||
/** FIXME: hack to work around signals being received too early */
|
|
||||||
bool m_ready;
|
|
||||||
|
|
||||||
|
|
||||||
/** TODO: check if this can be made private
|
/** TODO: check if this can be made private
|
||||||
* The native control has a getter to check for busy state, but except in
|
* The native control has a getter to check for busy state, but except in
|
||||||
* very recent versions of webkit this getter doesn't say everything we need
|
* very recent versions of webkit this getter doesn't say everything we need
|
||||||
|
@ -32,8 +32,6 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget,
|
|||||||
GParamSpec*,
|
GParamSpec*,
|
||||||
wxWebViewWebKit *webKitCtrl)
|
wxWebViewWebKit *webKitCtrl)
|
||||||
{
|
{
|
||||||
if (!webKitCtrl->m_ready) return;
|
|
||||||
|
|
||||||
wxString url = webKitCtrl->GetCurrentURL();
|
wxString url = webKitCtrl->GetCurrentURL();
|
||||||
|
|
||||||
WebKitLoadStatus status;
|
WebKitLoadStatus status;
|
||||||
@ -395,7 +393,6 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_ready = false;
|
|
||||||
m_busy = false;
|
m_busy = false;
|
||||||
m_guard = false;
|
m_guard = false;
|
||||||
|
|
||||||
@ -414,9 +411,6 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
|
|||||||
gtk_container_add(GTK_CONTAINER(m_widget), GTK_WIDGET(m_web_view));
|
gtk_container_add(GTK_CONTAINER(m_widget), GTK_WIDGET(m_web_view));
|
||||||
gtk_widget_show(GTK_WIDGET(m_web_view));
|
gtk_widget_show(GTK_WIDGET(m_web_view));
|
||||||
|
|
||||||
g_signal_connect_after(m_web_view, "notify::load-status",
|
|
||||||
G_CALLBACK(wxgtk_webview_webkit_load_status),
|
|
||||||
this);
|
|
||||||
g_signal_connect_after(m_web_view, "navigation-policy-decision-requested",
|
g_signal_connect_after(m_web_view, "navigation-policy-decision-requested",
|
||||||
G_CALLBACK(wxgtk_webview_webkit_navigation),
|
G_CALLBACK(wxgtk_webview_webkit_navigation),
|
||||||
this);
|
this);
|
||||||
@ -445,7 +439,10 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
|
|||||||
history = webkit_web_view_get_back_forward_list(m_web_view);
|
history = webkit_web_view_get_back_forward_list(m_web_view);
|
||||||
m_historyLimit = webkit_web_back_forward_list_get_limit(history);
|
m_historyLimit = webkit_web_back_forward_list_get_limit(history);
|
||||||
|
|
||||||
m_ready = true;
|
// last to avoid getting signal too early
|
||||||
|
g_signal_connect_after(m_web_view, "notify::load-status",
|
||||||
|
G_CALLBACK(wxgtk_webview_webkit_load_status),
|
||||||
|
this);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user