head-management: add format-info-v1 extension
This commit is contained in:
parent
4482c3168b
commit
1195613fc6
9 changed files with 84 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ use {
|
|||
crate::{
|
||||
backend::{ConnectorId, Mode, MonitorInfo, transaction::BackendConnectorTransactionError},
|
||||
client::ClientId,
|
||||
format::Format,
|
||||
globals::GlobalName,
|
||||
ifs::head_management::{
|
||||
head_management_macros::HeadExts, jay_head_manager_session_v1::JayHeadManagerSessionV1,
|
||||
|
|
@ -82,6 +83,7 @@ pub struct HeadState {
|
|||
pub vrr: bool,
|
||||
pub tearing_enabled: bool,
|
||||
pub tearing_active: bool,
|
||||
pub format: &'static Format,
|
||||
}
|
||||
|
||||
impl HeadState {
|
||||
|
|
@ -406,4 +408,16 @@ impl HeadManagers {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn handle_format_change(&self, format: &'static Format) {
|
||||
let state = &mut *self.state.borrow_mut();
|
||||
state.format = format;
|
||||
for head in self.managers.lock().values() {
|
||||
skip_in_transaction!(head);
|
||||
if let Some(ext) = &head.ext.format_info_v1 {
|
||||
ext.send_format(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue