head-management: add format-setter-v1 extension
This commit is contained in:
parent
e0120ed3bb
commit
15e68fc551
10 changed files with 131 additions and 0 deletions
|
|
@ -91,6 +91,7 @@ pub struct HeadState {
|
|||
pub format: &'static Format,
|
||||
pub color_space: BackendColorSpace,
|
||||
pub transfer_function: BackendTransferFunction,
|
||||
pub supported_formats: RcEq<Vec<&'static Format>>,
|
||||
}
|
||||
|
||||
impl HeadState {
|
||||
|
|
@ -129,6 +130,7 @@ enum HeadOp {
|
|||
SetNonDesktopOverride(Option<bool>),
|
||||
SetVrrMode(VrrMode),
|
||||
SetTearingMode(TearingMode),
|
||||
SetFormat(&'static Format),
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
|
||||
|
|
@ -481,4 +483,16 @@ impl HeadManagers {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn handle_formats_change(&self, formats: &Rc<Vec<&'static Format>>) {
|
||||
let state = &mut *self.state.borrow_mut();
|
||||
state.supported_formats.0 = formats.clone();
|
||||
for head in self.managers.lock().values() {
|
||||
skip_in_transaction!(head);
|
||||
if let Some(ext) = &head.ext.format_setter_v1 {
|
||||
ext.send_supported_formats(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue