From c2155050c7a10370d673df81fbad12633ee147a9 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 22 Oct 2014 16:34:31 -0500 Subject: [PATCH] wmifs: Prevent speedy scrolling problem. Patch by Barak Pearlmutter . First appeared in Debian package version 1.3b1-6. From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=83003: On my laptop, following a suspend, wmifs scrolls like nuts for a long time. The scroll speed looks the same as for a wmifs that is paused for a while using C-z. Here is a patch that prevents this speedy scrolling problem. I also got rid of a couple unnecessary compiler warnings. --- wmifs/wmifs/wmifs.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/wmifs/wmifs/wmifs.c b/wmifs/wmifs/wmifs.c index 5d584be..52ea3e5 100644 --- a/wmifs/wmifs/wmifs.c +++ b/wmifs/wmifs/wmifs.c @@ -185,6 +185,9 @@ #include "wmifs-master.xpm" #include "wmifs-mask.xbm" +/* How often to check for new network interface, in seconds */ +#define CHECK_INTERFACE_INTERVAL 5 + /***********/ /* Defines */ /***********/ @@ -202,7 +205,7 @@ #define WMIFS_VERSION "1.2.1" -/* the size of the buffer read from /proc/net/* */ +/* the size of the buffer read from /proc/net/ */ #define BUFFER_SIZE 512 /**********************/ /* External Variables */ @@ -254,7 +257,7 @@ void get_ppp_stats(struct ppp_stats *cur); /* Main */ /********/ -void main(int argc, char *argv[]) { +int main(int argc, char *argv[]) { int i; @@ -296,6 +299,7 @@ void main(int argc, char *argv[]) { } wmifs_routine(argc, argv); + return 0; } /*******************************************************************************\ @@ -341,9 +345,9 @@ void wmifs_routine(int argc, char **argv) { int stat_online; int stat_current; - long starttime; - long curtime; - long nexttime; + time_t starttime; + time_t curtime; + time_t nexttime; long ipacket, opacket, istat, ostat; @@ -391,7 +395,7 @@ void wmifs_routine(int argc, char **argv) { AddMouseRegion(1, 5, 20, 58, 58); starttime = time(0); - nexttime = starttime + 5; + nexttime = starttime + CHECK_INTERFACE_INTERVAL; for (i=0; i= nexttime) { - nexttime+=5; + + nexttime=curtime+CHECK_INTERFACE_INTERVAL; for (i=0; i