Xinqi Bao's Git
projects
/
st.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
0f6942c
)
Fixed lock up when system time jumps backwards
author
Rob Pilling <rob@egbert>
Wed, 19 Jun 2013 20:24:01 +0000
(21:24 +0100)
committer
Christoph Lohmann <
[email protected]
>
Sun, 27 Oct 2013 12:17:11 +0000
(13:17 +0100)
Signed-off-by: Christoph Lohmann <
[email protected]
>
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
50b58a7
..
d0a6218
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-3687,6
+3687,8
@@
run(void) {
gettimeofday(&last, NULL);
for(xev = actionfps;;) {
gettimeofday(&last, NULL);
for(xev = actionfps;;) {
+ long deltatime;
+
FD_ZERO(&rfd);
FD_SET(cmdfd, &rfd);
FD_SET(xfd, &rfd);
FD_ZERO(&rfd);
FD_SET(cmdfd, &rfd);
FD_SET(xfd, &rfd);
@@
-3720,8
+3722,9
@@
run(void) {
gettimeofday(&lastblink, NULL);
dodraw = 1;
}
gettimeofday(&lastblink, NULL);
dodraw = 1;
}
- if(TIMEDIFF(now, last) \
- > (xev? (1000/xfps) : (1000/actionfps))) {
+ deltatime = TIMEDIFF(now, last);
+ if(deltatime > (xev? (1000/xfps) : (1000/actionfps))
+ || deltatime < 0) {
dodraw = 1;
last = now;
}
dodraw = 1;
last = now;
}