summaryrefslogtreecommitdiff
path: root/app-admin/conky/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-27 06:06:27 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-27 06:06:27 +0000
commit8d5dbd847cbc704a6a06405856e94b461011afe3 (patch)
tree4d26462d027b14926335894749d2e01d982234d0 /app-admin/conky/files
parent5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 (diff)
gentoo resync : 27.03.2021
Diffstat (limited to 'app-admin/conky/files')
-rw-r--r--app-admin/conky/files/conky-1.12.1-network-speed.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/app-admin/conky/files/conky-1.12.1-network-speed.patch b/app-admin/conky/files/conky-1.12.1-network-speed.patch
new file mode 100644
index 000000000000..46a7615c589a
--- /dev/null
+++ b/app-admin/conky/files/conky-1.12.1-network-speed.patch
@@ -0,0 +1,36 @@
+From 415c730133476d6652f479242b0638496b5f673b Mon Sep 17 00:00:00 2001
+From: Steven Xu <stevenxxiu@gmail.com>
+Date: Tue, 23 Mar 2021 20:12:52 +1100
+Subject: [PATCH] fix: update `update last_update_time` earlier, so the network
+ speed is correctly displayed, otherwise the speed shown is much lower than
+ the actual speed (resolves #863)
+
+---
+ src/conky.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/conky.cc b/src/conky.cc
+index b116b2bed..af5602c5b 100644
+--- a/src/conky.cc
++++ b/src/conky.cc
+@@ -766,6 +766,12 @@ static void generate_text() {
+ * some info.mem entries */
+ update_stuff();
+
++ /* Update `last_update_time` before `generate_text_internal()`, as the latter
++ * calls `evaluate()` -> `update_net_stats()`, which needs `last_update_time`
++ * to be set correctly. If this is not done, than the network speed being
++ * shown will be much lower than the actual speed.*/
++ last_update_time = current_update_time;
++
+ /* populate the text buffer; generate_text_internal() iterates through
+ * global_root_object (an instance of the text_object struct) and calls
+ * any callbacks that were set on startup by construct_text_object(). */
+@@ -822,7 +828,6 @@ static void generate_text() {
+ if (next_update_time < time || next_update_time > time + ui) {
+ next_update_time = time - fmod(time, ui) + ui;
+ }
+- last_update_time = current_update_time;
+ total_updates++;
+ }
+