Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
- --- a/pidgin/gtkwebview.c
- +++ b/pidgin/gtkwebview.c
- @@ -705,8 +705,8 @@
- }
- }
- -static gboolean
- -process_load_queue(GtkWebView *webview)
- +static void
- +process_load_queue_element(GtkWebView *webview)
- {
- GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview);
- int type;
- @@ -717,15 +717,6 @@
- WebKitDOMRange *range;
- gboolean require_scroll = FALSE;
- - if (priv->is_loading) {
- - priv->loader = 0;
- - return FALSE;
- - }
- - if (!priv->load_queue || g_queue_is_empty(priv->load_queue)) {
- - priv->loader = 0;
- - return FALSE;
- - }
- -
- type = GPOINTER_TO_INT(g_queue_pop_head(priv->load_queue));
- str = g_queue_pop_head(priv->load_queue);
- @@ -783,7 +774,34 @@
- }
- g_free(str);
- +}
- +static gboolean
- +process_load_queue(GtkWebView *webview)
- +{
- + GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview);
- + gint64 start_time;
- +
- + if (priv->is_loading) {
- + priv->loader = 0;
- + return FALSE;
- + }
- + if (!priv->load_queue || g_queue_is_empty(priv->load_queue)) {
- + priv->loader = 0;
- + return FALSE;
- + }
- +
- + start_time = g_get_monotonic_time();
- + while (!g_queue_is_empty(priv->load_queue)) {
- + process_load_queue_element(webview);
- + if (g_get_monotonic_time() - start_time > 100000) /* 100ms */
- + break;
- + }
- +
- + if (g_queue_is_empty(priv->load_queue)) {
- + priv->loader = 0;
- + return FALSE;
- + }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement