metal: preserve mode across reconnects
This commit is contained in:
parent
c81f35bdf1
commit
9bab4f7ce1
11 changed files with 148 additions and 107 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue