[epiphany/gnome-3-32] web-view: don't connect to embed-shell in page-created cb
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-32] web-view: don't connect to embed-shell in page-created cb
- Date: Thu, 5 Sep 2019 20:20:00 +0000 (UTC)
commit 6db01dbfc48dc1b09217f9bfb549b6efdec598d8
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Sep 4 08:54:11 2019 -0500
web-view: don't connect to embed-shell in page-created cb
This isn't the right place. It could lead to these signals being
connected multiple times due to PSON.
embed/ephy-web-view.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index d6b10700f..ca3aef728 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -914,18 +914,6 @@ page_created_cb (EphyEmbedShell *shell,
view->web_extension = web_extension;
g_object_add_weak_pointer (G_OBJECT (view->web_extension), (gpointer *)&view->web_extension);
-
- g_signal_connect_object (shell, "sensitive-form-focused",
- G_CALLBACK (sensitive_form_focused_cb),
- view, 0);
-
- g_signal_connect_object (shell, "allow-tls-certificate",
- G_CALLBACK (allow_tls_certificate_cb),
- view, 0);
-
- g_signal_connect_object (shell, "allow-unsafe-browsing",
- G_CALLBACK (allow_unsafe_browsing_cb),
- view, 0);
}
static void
@@ -2817,6 +2805,10 @@ reader_setting_changed_cb (GSettings *settings,
static void
ephy_web_view_init (EphyWebView *web_view)
{
+ EphyEmbedShell *shell;
+
+ shell = ephy_embed_shell_get_default ();
+
web_view->is_blank = TRUE;
web_view->ever_committed = FALSE;
web_view->document_type = EPHY_WEB_VIEW_DOCUMENT_HTML;
@@ -2824,7 +2816,7 @@ ephy_web_view_init (EphyWebView *web_view)
web_view->file_monitor = ephy_file_monitor_new (web_view);
- web_view->history_service = ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ());
+ web_view->history_service = ephy_embed_shell_get_global_history_service (shell);
web_view->history_service_cancellable = g_cancellable_new ();
g_signal_connect_object (EPHY_SETTINGS_READER, "changed::" EPHY_PREFS_READER_FONT_STYLE,
@@ -2890,9 +2882,21 @@ ephy_web_view_init (EphyWebView *web_view)
G_CALLBACK (new_window_cb),
NULL);
- g_signal_connect_object (ephy_embed_shell_get_default (), "page-created",
+ g_signal_connect_object (shell, "page-created",
G_CALLBACK (page_created_cb),
web_view, 0);
+
+ g_signal_connect_object (shell, "sensitive-form-focused",
+ G_CALLBACK (sensitive_form_focused_cb),
+ web_view, 0);
+
+ g_signal_connect_object (shell, "allow-tls-certificate",
+ G_CALLBACK (allow_tls_certificate_cb),
+ web_view, 0);
+
+ g_signal_connect_object (shell, "allow-unsafe-browsing",
+ G_CALLBACK (allow_unsafe_browsing_cb),
+ web_view, 0);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]