head-management: add vrr-state-v1 extension
This commit is contained in:
parent
b76aade265
commit
aaef75f9f3
9 changed files with 108 additions and 0 deletions
|
|
@ -79,6 +79,7 @@ pub struct HeadState {
|
|||
pub monitor_info: Option<RcEq<MonitorInfo>>,
|
||||
pub inherent_non_desktop: bool,
|
||||
pub override_non_desktop: Option<bool>,
|
||||
pub vrr: bool,
|
||||
}
|
||||
|
||||
impl HeadState {
|
||||
|
|
@ -249,6 +250,10 @@ impl HeadManagers {
|
|||
ext.send_state(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
if let Some(ext) = &head.ext.vrr_state_v1 {
|
||||
ext.send_state(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -275,6 +280,10 @@ impl HeadManagers {
|
|||
ext.send_info(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
if let Some(ext) = &head.ext.vrr_state_v1 {
|
||||
ext.send_state(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -359,4 +368,16 @@ impl HeadManagers {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn handle_vrr_change(&self, vrr: bool) {
|
||||
let state = &mut *self.state.borrow_mut();
|
||||
state.vrr = vrr;
|
||||
for head in self.managers.lock().values() {
|
||||
skip_in_transaction!(head);
|
||||
if let Some(ext) = &head.ext.vrr_state_v1 {
|
||||
ext.send_state(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue