Merge pull request #57 from yshui/refresh0
Don't delay update when refresh rate is not available
This commit is contained in:
commit
3a9ec744fc
|
@ -3173,9 +3173,8 @@ ev_screen_change_notify(session_t *ps,
|
||||||
if (ps->o.sw_opti && !ps->o.refresh_rate) {
|
if (ps->o.sw_opti && !ps->o.refresh_rate) {
|
||||||
update_refresh_rate(ps);
|
update_refresh_rate(ps);
|
||||||
if (!ps->refresh_rate) {
|
if (!ps->refresh_rate) {
|
||||||
fprintf(stderr, "ev_screen_change_notify(): Refresh rate detection "
|
fprintf(stderr, "ev_screen_change_notify(): Refresh rate detection failed."
|
||||||
"failed, --sw-opti disabled.");
|
"swopti will be temporarily disabled");
|
||||||
ps->o.sw_opti = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4413,6 +4412,9 @@ swopti_init(session_t *ps) {
|
||||||
*/
|
*/
|
||||||
static double
|
static double
|
||||||
swopti_handle_timeout(session_t *ps) {
|
swopti_handle_timeout(session_t *ps) {
|
||||||
|
if (!ps->refresh_intv)
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Get the microsecond offset of the time when the we reach the timeout
|
// Get the microsecond offset of the time when the we reach the timeout
|
||||||
// I don't think a 32-bit long could overflow here.
|
// I don't think a 32-bit long could overflow here.
|
||||||
long offset = (get_time_timeval().tv_usec - ps->paint_tm_offset) % ps->refresh_intv;
|
long offset = (get_time_timeval().tv_usec - ps->paint_tm_offset) % ps->refresh_intv;
|
||||||
|
|
Loading…
Reference in New Issue