1
0
Fork 0
forked from wry/wry

autocommit 2022-04-16 13:42:13 CEST

This commit is contained in:
Julian Orth 2022-04-16 13:42:13 +02:00
parent 4826305236
commit 50b792db78
27 changed files with 217 additions and 60 deletions

View file

@ -23,6 +23,11 @@ impl BackendEventHandler {
match event {
BackendEvent::NewConnector(connector) => connector::handle(&self.state, &connector),
BackendEvent::NewInputDevice(s) => input_device::handle(&self.state, s),
BackendEvent::GraphicsInitialized => {
if let Some(config) = self.state.config.get() {
config.graphics_initialized();
}
}
}
}
}

View file

@ -100,8 +100,8 @@ fn now() -> c::timespec {
fn duration_since(start: c::timespec) -> Duration {
let now = now();
let mut nanos =
(now.tv_sec as i64 - start.tv_sec as i64) * 1_000_000_000 + (now.tv_nsec as i64 - start.tv_nsec as i64);
let mut nanos = (now.tv_sec as i64 - start.tv_sec as i64) * 1_000_000_000
+ (now.tv_nsec as i64 - start.tv_nsec as i64);
if nanos < 0 {
log::error!("Time has gone backwards.");
nanos = 0;