aboutsummaryrefslogtreecommitdiff
path: root/src/protocols
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-08-08 10:19:01 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-08-08 13:32:37 +0300
commit07bd76e219a8838f04cf21ea12827363b08dff47 (patch)
tree37ef99835e859babceb38f8763417f994a3f7a2a /src/protocols
parentb6a7b3e9e4715c099b1d0e67252c0a149238d683 (diff)
downloadniri-07bd76e219a8838f04cf21ea12827363b08dff47.tar.gz
niri-07bd76e219a8838f04cf21ea12827363b08dff47.tar.bz2
niri-07bd76e219a8838f04cf21ea12827363b08dff47.zip
screencopy: Use monotonic time
This way it matches up with presentation-time.
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/screencopy.rs5
1 files changed, 3 insertions, 2 deletions
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();