summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--browser.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 52a7129..8951362 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
Release history for lariza
next
+ [Fixed]
+ - Lariza no longer reports download progress below 0% or above 100%.
+ (Workaround for what appears to be a WebKit2GTK+ bug.)
+
[Changed]
- We no longer explicitly set the X11 window's class and name. Let
GTK+ do this job. The actual class and name should be unchanged,
diff --git a/browser.c b/browser.c
index 616f485..219bc05 100644
--- a/browser.c
+++ b/browser.c
@@ -279,7 +279,10 @@ changed_download_progress(GObject *obj, GParamSpec *pspec, gpointer data)
const gchar *uri;
gchar *t, *filename, *base;
- p = webkit_download_get_estimated_progress(download) * 100;
+ p = webkit_download_get_estimated_progress(download);
+ p = p > 1 ? 1 : p;
+ p = p < 0 ? 0 : p;
+ p *= 100;
resp = webkit_download_get_response(download);
size_mb = webkit_uri_response_get_content_length(resp) / 1e6;