autocommit 2022-04-05 18:28:42 CEST
This commit is contained in:
parent
1f05ea431e
commit
a3e9f21fc5
29 changed files with 568 additions and 225 deletions
|
|
@ -1,7 +1,6 @@
|
|||
use crate::backend::{BackendEvent, Connector};
|
||||
use crate::backend::{BackendEvent};
|
||||
use crate::state::State;
|
||||
use crate::tasks::input_device;
|
||||
use crate::tasks::output::OutputHandler;
|
||||
use crate::tasks::{connector, input_device};
|
||||
use std::rc::Rc;
|
||||
|
||||
pub struct BackendEventHandler {
|
||||
|
|
@ -18,18 +17,8 @@ impl BackendEventHandler {
|
|||
|
||||
fn handle_event(&mut self, event: BackendEvent) {
|
||||
match event {
|
||||
BackendEvent::NewConnector(output) => self.handle_new_output(output),
|
||||
BackendEvent::NewConnector(connector) => connector::handle(&self.state, &connector),
|
||||
BackendEvent::NewInputDevice(s) => input_device::handle(&self.state, s),
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_new_output(&mut self, output: Rc<dyn Connector>) {
|
||||
let id = output.id();
|
||||
let oh = OutputHandler {
|
||||
state: self.state.clone(),
|
||||
output,
|
||||
};
|
||||
let future = self.state.eng.spawn(oh.handle());
|
||||
self.state.output_handlers.borrow_mut().insert(id, future);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue