From 95432ec457967e2c9168d8978725eb7ef1550880 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 8 Sep 2019 12:00:22 +0300 Subject: [PATCH] Ticket #3859: rotating dash generates way too much output. (rotate_dash): draw rotating dash with maximum rate of 10 FPS. Signed-off-by: Andrew Borodin --- src/filemanager/layout.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index d0921979f..3dc1d6449 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -50,6 +50,7 @@ #include "lib/strutil.h" #include "lib/widget.h" #include "lib/event.h" +#include "lib/util.h" /* mc_time_elapsed() */ #include "src/consaver/cons.saver.h" #include "src/viewer/mcviewer.h" /* The view widget */ @@ -953,11 +954,18 @@ set_hintbar (const char *str) void rotate_dash (gboolean show) { + static guint64 timestamp = 0; + /* update with 10 FPS rate */ + static const guint64 delay = G_USEC_PER_SEC / 10; + const Widget *w = CONST_WIDGET (midnight_dlg); if (!nice_rotating_dash || (ok_to_refresh <= 0)) return; + if (show && !mc_time_elapsed (×tamp, delay)) + return; + widget_move (w, (menubar_visible != 0) ? 1 : 0, w->cols - 1); tty_setcolor (NORMAL_COLOR);