refactor fakeinput + invert main thread function
- fakeinput is now just a series of free functions that access the global static, which makes more sense than having some arbitrary zero-sized-struct with associated methods on it. - instead of having the active notification run in its own thread, it now runs on the main thread, and the controller runs in a separate thread. This results in midly nicer code, at least IMO. Also, I've had to disable optimizations on the evdev_rs crate, as it seems to be segfaulting on release builds. Very spooky, but it's not something I'm super interested in debugging right now, so I'll just work around it. It's not like I need the _blazing fast performance_ from a Rust wrapper around a C library anyways...
This commit is contained in:
@@ -16,6 +16,7 @@ pub enum Error {
|
||||
UnexpectedEvt(InputEvent),
|
||||
Evdev(io::Error),
|
||||
Notif(notify_rust::error::Error),
|
||||
TermSig,
|
||||
}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
@@ -30,6 +31,7 @@ impl fmt::Display for Error {
|
||||
Error::UnexpectedEvt(evt) => write!(f, "Unexpected event: {:?}", evt),
|
||||
Error::Evdev(e) => write!(f, "Evdev error: {}", e),
|
||||
Error::Notif(e) => write!(f, "Notification error: {}", e),
|
||||
Error::TermSig => write!(f, "Received termination signal (either SIGTERM or SIGINT)"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user