From 07bd76e219a8838f04cf21ea12827363b08dff47 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 8 Aug 2024 10:19:01 +0300 Subject: screencopy: Use monotonic time This way it matches up with presentation-time. --- src/protocols/screencopy.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/protocols') diff --git a/src/protocols/screencopy.rs b/src/protocols/screencopy.rs index 74c891d0..2dd9e316 100644 --- a/src/protocols/screencopy.rs +++ b/src/protocols/screencopy.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; -use std::time::UNIX_EPOCH; use smithay::backend::allocator::dmabuf::Dmabuf; use smithay::backend::allocator::{Buffer, Fourcc}; @@ -22,6 +21,8 @@ use smithay::reexports::wayland_server::{ use smithay::utils::{Physical, Point, Rectangle, Size, Transform}; use smithay::wayland::{dmabuf, shm}; +use crate::utils::get_monotonic_time; + const VERSION: u32 = 3; pub struct ScreencopyQueue { @@ -470,7 +471,7 @@ impl Screencopy { }); // Notify client about successful copy. - let time = UNIX_EPOCH.elapsed().unwrap(); + let time = get_monotonic_time(); let tv_sec_hi = (time.as_secs() >> 32) as u32; let tv_sec_lo = (time.as_secs() & 0xFFFFFFFF) as u32; let tv_nsec = time.subsec_nanos(); -- cgit