mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 15:25:58 +01:00
Fixed lock up when system time jumps backwards
Signed-off-by: Christoph Lohmann <20h@r-36.net>
This commit is contained in:
parent
0f6942cdf6
commit
489982d4b8
1 changed files with 5 additions and 2 deletions
7
st.c
7
st.c
|
@ -3687,6 +3687,8 @@ run(void) {
|
||||||
gettimeofday(&last, NULL);
|
gettimeofday(&last, NULL);
|
||||||
|
|
||||||
for(xev = actionfps;;) {
|
for(xev = actionfps;;) {
|
||||||
|
long deltatime;
|
||||||
|
|
||||||
FD_ZERO(&rfd);
|
FD_ZERO(&rfd);
|
||||||
FD_SET(cmdfd, &rfd);
|
FD_SET(cmdfd, &rfd);
|
||||||
FD_SET(xfd, &rfd);
|
FD_SET(xfd, &rfd);
|
||||||
|
@ -3720,8 +3722,9 @@ run(void) {
|
||||||
gettimeofday(&lastblink, NULL);
|
gettimeofday(&lastblink, NULL);
|
||||||
dodraw = 1;
|
dodraw = 1;
|
||||||
}
|
}
|
||||||
if(TIMEDIFF(now, last) \
|
deltatime = TIMEDIFF(now, last);
|
||||||
> (xev? (1000/xfps) : (1000/actionfps))) {
|
if(deltatime > (xev? (1000/xfps) : (1000/actionfps))
|
||||||
|
|| deltatime < 0) {
|
||||||
dodraw = 1;
|
dodraw = 1;
|
||||||
last = now;
|
last = now;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue