outputs: Notify the state manager about changes
This commit is contained in:
14
src/state.rs
14
src/state.rs
@ -8,6 +8,7 @@
|
||||
use crate::animation;
|
||||
use crate::imservice::{ ContentHint, ContentPurpose };
|
||||
use crate::main::{ Commands, PanelCommand };
|
||||
use crate::outputs;
|
||||
use std::time::Instant;
|
||||
|
||||
|
||||
@ -36,7 +37,7 @@ pub enum Event {
|
||||
InputMethod(InputMethod),
|
||||
Visibility(visibility::Event),
|
||||
PhysicalKeyboard(Presence),
|
||||
|
||||
Output(outputs::Event),
|
||||
/// Event triggered because a moment in time passed.
|
||||
/// Use to animate state transitions.
|
||||
/// The value is the ideal arrival time.
|
||||
@ -49,6 +50,12 @@ impl From<InputMethod> for Event {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<outputs::Event> for Event {
|
||||
fn from(ev: outputs::Event) -> Self {
|
||||
Self::Output(ev)
|
||||
}
|
||||
}
|
||||
|
||||
pub mod visibility {
|
||||
#[derive(Clone)]
|
||||
pub enum Event {
|
||||
@ -166,6 +173,11 @@ impl Application {
|
||||
..self
|
||||
},
|
||||
|
||||
Event::Output(output) => {
|
||||
println!("Stub: output event {:?}", output);
|
||||
self
|
||||
},
|
||||
|
||||
Event::InputMethod(new_im) => match (self.im.clone(), new_im) {
|
||||
(InputMethod::Active(_old), InputMethod::Active(new_im))
|
||||
=> Self {
|
||||
|
||||
Reference in New Issue
Block a user