1
1
mirror of https://github.com/wez/wezterm.git synced 2025-01-03 11:11:43 +03:00

Instant::elapsed()

This commit is contained in:
Wez Furlong 2019-12-31 15:56:41 -08:00
parent 253c36bf8c
commit 364fc147be

View File

@ -222,8 +222,7 @@ impl WindowCallbacks for TermWindow {
}
WMEK::Press(_) => {
if let Some(focused) = self.focused.as_ref() {
let now = Instant::now();
if now.duration_since(*focused) <= Duration::from_millis(200) {
if focused.elapsed() <= Duration::from_millis(200) {
log::trace!("discard mouse click because it focused the window");
return;
}