From c903384a2c470d0a2e137191f124aee61ebe861b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 9 Apr 2018 16:11:49 +0200 Subject: [PATCH] [EMailDisplay] Do not call reload when nothing is loaded It can happen that the EMailDisplay's reload, due to property changes, is scheduled for idle during the EMailBrowser construction and that idle callback is called when WebKitGTK+ doesn't have loaded expected URI in it, only "about:blank". Calling reload in such state can prevent the real (and possibly ongoing) request to be cancelled, which results in an empty message preview. Avoiding schedule of such false reload helps to prevent this situation. This had been reported downstream at: https://bugzilla.redhat.com/show_bug.cgi?id=1560312 --- src/mail/e-mail-display.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mail/e-mail-display.c b/src/mail/e-mail-display.c index b7d00a11b2..65506edfd9 100644 --- a/src/mail/e-mail-display.c +++ b/src/mail/e-mail-display.c @@ -2568,7 +2568,7 @@ do_reload_display (EMailDisplay *display) display->priv->scheduled_reload = 0; - if (uri == NULL || *uri == '\0') + if (!uri || !*uri || g_ascii_strcasecmp (uri, "about:blank") == 0) return FALSE; if (strstr (uri, "?") == NULL) { @@ -2623,9 +2623,14 @@ do_reload_display (EMailDisplay *display) void e_mail_display_reload (EMailDisplay *display) { + const gchar *uri; + g_return_if_fail (E_IS_MAIL_DISPLAY (display)); - if (display->priv->scheduled_reload > 0) + uri = webkit_web_view_get_uri (WEBKIT_WEB_VIEW (display)); + + if (!uri || !*uri || g_ascii_strcasecmp (uri, "about:blank") == 0 || + display->priv->scheduled_reload > 0) return; /* Schedule reloading if neccessary. -- 2.11.4.GIT