1
0
Fork 0
forked from wry/wry
wry/src/output_schedule.rs

35 lines
909 B
Rust

pub use jay_output_schedule::*;
use {
crate::{
ifs::wl_output::PersistentOutputState,
state::{ConnectorData, State},
},
std::rc::Rc,
};
impl OutputSchedulePersistent for PersistentOutputState {
fn vrr_cursor_hz(&self) -> Option<f64> {
self.vrr_cursor_hz.get()
}
fn set_vrr_cursor_hz(&self, hz: Option<f64>) {
self.vrr_cursor_hz.set(hz);
}
}
pub fn create_output_schedule(
state: &State,
connector: &Rc<ConnectorData>,
persistent: &Rc<PersistentOutputState>,
) -> OutputSchedule {
let damage_connector = connector.clone();
let cursor_hz_connector = connector.clone();
OutputSchedule::new(
state.ring.clone(),
state.eng.clone(),
persistent.clone(),
Rc::new(move || damage_connector.damage()),
Rc::new(move |hz| cursor_hz_connector.head_managers.handle_cursor_hz_change(hz)),
)
}