[epiphany/gnome-2-28] ephy-window.c: workaround bug in WebKit progress notification
- From: Xan Lopez <xan src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-2-28] ephy-window.c: workaround bug in WebKit progress notification
- Date: Sat, 17 Oct 2009 21:16:30 +0000 (UTC)
commit e261aebd573050e90ae4437cac8c880079af4c56
Author: Xan Lopez <xan gnome org>
Date: Thu Sep 24 17:30:41 2009 +0300
ephy-window.c: workaround bug in WebKit progress notification
LOAD_FINISHED is notified before progress 100% completed, which makes
it very hard to rely on those signals to figure out if a page is still
loading or not when syncing progress in a tab. Try to workaround this
as best as possible.
src/ephy-window.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 635a779..d7c9b23 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1607,6 +1607,7 @@ sync_tab_load_progress (EphyWebView *view, GParamSpec *pspec, EphyWindow *window
gdouble progress;
const char *uri;
gboolean loading;
+ gboolean switching_tab = pspec == NULL;
if (window->priv->closing) return;
@@ -1622,13 +1623,19 @@ sync_tab_load_progress (EphyWebView *view, GParamSpec *pspec, EphyWindow *window
for about:blank until the load is finished, so assume NULL
here means we are loading about:blank. This might not be
rigt :) */
- loading = ephy_web_view_is_loading (view);
+ /* All the weird checks for progress == 1.0 and !switching_tab
+ * are because we receive first the LOAD_FINISHED status than
+ * the 100% progress report, so for progress == 1.0 there's no
+ * sane way of knowing whether we are still loading or
+ * not. See https://bugs.webkit.org/show_bug.cgi?id=28851 */
uri = webkit_web_view_get_uri (WEBKIT_WEB_VIEW (view));
- if (loading && (!uri || strcmp (uri, "about:blank") == 0))
+ if (!switching_tab && (!uri || strcmp (uri, "about:blank") == 0))
return;
progress = webkit_web_view_get_progress (WEBKIT_WEB_VIEW (view));
- if (progress == 1.0 && loading)
+ loading = ephy_web_view_is_loading (view);
+
+ if (progress == 1.0 && !switching_tab)
{
window->priv->clear_progress_timeout_id =
g_timeout_add (500,
@@ -1639,7 +1646,7 @@ sync_tab_load_progress (EphyWebView *view, GParamSpec *pspec, EphyWindow *window
/* Do not set progress in the entry if the load is already
finished */
gtk_entry_set_progress_fraction (GTK_ENTRY (window->priv->entry),
- loading ? progress : 0.0);
+ loading || (progress == 1.0 && !switching_tab) ? progress : 0.0);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]