diff options
| -rw-r--r-- | src/backend/tty.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs index c60dc4a0..01f10fb6 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -956,16 +956,17 @@ impl Tty { .unwrap_or(Duration::ZERO); // FIXME: ideally should be monotonically increasing for a surface. let seq = meta.sequence as u64; - let flags = wp_presentation_feedback::Kind::Vsync - | wp_presentation_feedback::Kind::HwClock + let mut flags = wp_presentation_feedback::Kind::Vsync | wp_presentation_feedback::Kind::HwCompletion; - feedback.presented::<_, smithay::utils::Monotonic>( - presentation_time, - refresh, - seq, - flags, - ); + let time = if presentation_time.is_zero() { + now + } else { + flags.insert(wp_presentation_feedback::Kind::HwClock); + presentation_time + }; + + feedback.presented::<_, smithay::utils::Monotonic>(time, refresh, seq, flags); if !presentation_time.is_zero() { let misprediction_s = |
