1
0
Fork 0
forked from wry/wry

metal: preserve mode across reconnects

This commit is contained in:
Julian Orth 2024-09-04 19:00:52 +02:00
parent c81f35bdf1
commit 9bab4f7ce1
11 changed files with 148 additions and 107 deletions

View file

@ -96,14 +96,30 @@ pub struct PersistentOutputState {
pub tearing_mode: Cell<&'static TearingMode>,
}
#[derive(Eq, PartialEq, Hash)]
#[derive(Eq, PartialEq, Hash, Debug)]
pub struct OutputId {
pub connector: String,
pub connector: Option<String>,
pub manufacturer: String,
pub model: String,
pub serial_number: String,
}
impl OutputId {
pub fn new(
connector: String,
manufacturer: String,
model: String,
serial_number: String,
) -> Self {
Self {
connector: serial_number.is_empty().then_some(connector),
manufacturer,
model,
serial_number,
}
}
}
impl WlOutputGlobal {
pub fn clear(&self) {
self.opt.clear();