diff options
author | Shaun McCance <shaunm@gnome.org> | 2011-04-16 13:26:39 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2011-04-16 13:26:39 -0400 |
commit | 9dcb90e3d9d4b34d8c363f53bb4e1c39da7317c5 (patch) | |
tree | d08d2bad2919dd733ac486acffcd488f9fa7c20f | |
parent | e27023aef0eabc579cfb8062989a6ebe4f199052 (diff) | |
download | yelp-9dcb90e3d9d4b34d8c363f53bb4e1c39da7317c5.tar.gz |
yelp-view: Don't spin loading cursor forever
-rw-r--r-- | libyelp/yelp-view.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c index 79f9b920..15f6c9fc 100644 --- a/libyelp/yelp-view.c +++ b/libyelp/yelp-view.c @@ -2084,8 +2084,17 @@ document_callback (YelpDocument *document, * let the main loop run through. */ if (priv->vadjust > 0 || priv->hadjust > 0 || priv->page_title == NULL) - while (g_main_context_pending (NULL)) + while (g_main_context_pending (NULL)) { + WebKitLoadStatus status; + status = webkit_web_view_get_load_status (WEBKIT_WEB_VIEW (view)); g_main_context_iteration (NULL, FALSE); + /* Sometimes some runaway JavaScript causes there to always + * be pending sources. Break out of the document is loaded. + */ + if (status == WEBKIT_LOAD_FINISHED || + status == WEBKIT_LOAD_FAILED) + break; + } /* Setting adjustments only work after the page is loaded. These * are set by view_history_action, and they're reset to 0 after |