head-management: handle additional properties
This commit is contained in:
parent
cbe190274e
commit
da01d7e0d3
5 changed files with 44 additions and 4 deletions
|
|
@ -36,7 +36,7 @@ use {
|
|||
HeadManagers, HeadState, jay_head_manager_session_v1::handle_jay_head_manager_done,
|
||||
},
|
||||
jay_screencast::{perform_screencast_realloc, perform_toplevel_screencasts},
|
||||
wl_output::{OutputId, PersistentOutputState, WlOutputGlobal},
|
||||
wl_output::{BlendSpace, OutputId, PersistentOutputState, WlOutputGlobal},
|
||||
wl_seat::handle_position_hint_requests,
|
||||
wl_surface::{
|
||||
NoneSurfaceExt, xdg_surface::handle_xdg_surface_configure_events,
|
||||
|
|
@ -704,6 +704,9 @@ fn create_dummy_output(state: &Rc<State>) {
|
|||
eotf: backend_state.eotf,
|
||||
supported_formats: Default::default(),
|
||||
brightness: None,
|
||||
blend_space: BlendSpace::Srgb,
|
||||
use_native_gamut: false,
|
||||
vrr_cursor_hz: None,
|
||||
};
|
||||
let connector_data = Rc::new(ConnectorData {
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@ use {
|
|||
client::ClientId,
|
||||
format::Format,
|
||||
globals::GlobalName,
|
||||
ifs::head_management::{
|
||||
head_management_macros::HeadExts, jay_head_manager_session_v1::JayHeadManagerSessionV1,
|
||||
jay_head_v1::JayHeadV1,
|
||||
ifs::{
|
||||
head_management::{
|
||||
head_management_macros::HeadExts,
|
||||
jay_head_manager_session_v1::JayHeadManagerSessionV1, jay_head_v1::JayHeadV1,
|
||||
},
|
||||
wl_output::BlendSpace,
|
||||
},
|
||||
scale::Scale,
|
||||
state::OutputData,
|
||||
|
|
@ -92,6 +95,9 @@ pub struct HeadState {
|
|||
pub eotf: BackendEotfs,
|
||||
pub supported_formats: RcEq<Vec<&'static Format>>,
|
||||
pub brightness: Option<f64>,
|
||||
pub blend_space: BlendSpace,
|
||||
pub use_native_gamut: bool,
|
||||
pub vrr_cursor_hz: Option<f64>,
|
||||
}
|
||||
|
||||
pub struct ReadOnlyHeadState {
|
||||
|
|
@ -258,6 +264,10 @@ impl HeadManagers {
|
|||
state.transform = n.global.persistent.transform.get();
|
||||
state.vrr_mode = n.global.persistent.vrr_mode.get();
|
||||
state.tearing_mode = n.global.persistent.tearing_mode.get();
|
||||
state.brightness = n.global.persistent.brightness.get();
|
||||
state.blend_space = n.global.persistent.blend_space.get();
|
||||
state.use_native_gamut = n.global.persistent.use_native_gamut.get();
|
||||
state.vrr_cursor_hz = n.global.persistent.vrr_cursor_hz.get();
|
||||
}
|
||||
for head in self.managers.lock().values() {
|
||||
skip_in_transaction!(head);
|
||||
|
|
@ -548,4 +558,19 @@ impl HeadManagers {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn handle_blend_space_change(&self, blend_space: BlendSpace) {
|
||||
let state = &mut *self.state.borrow_mut();
|
||||
state.blend_space = blend_space;
|
||||
}
|
||||
|
||||
pub fn handle_use_native_gamut_change(&self, use_native_gamut: bool) {
|
||||
let state = &mut *self.state.borrow_mut();
|
||||
state.use_native_gamut = use_native_gamut;
|
||||
}
|
||||
|
||||
pub fn handle_cursor_hz_change(&self, cursor_hz: Option<f64>) {
|
||||
let state = &mut *self.state.borrow_mut();
|
||||
state.vrr_cursor_hz = cursor_hz;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ impl OutputSchedule {
|
|||
Some(v) => v,
|
||||
};
|
||||
self.persistent.vrr_cursor_hz.set(hz);
|
||||
self.connector.head_managers.handle_cursor_hz_change(hz);
|
||||
self.cursor_delta_nsec.set(delta);
|
||||
self.trigger();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ pub fn handle(state: &Rc<State>, connector: &Rc<dyn Connector>) {
|
|||
eotf: backend_state.eotf,
|
||||
supported_formats: Default::default(),
|
||||
brightness: None,
|
||||
blend_space: BlendSpace::Srgb,
|
||||
use_native_gamut: false,
|
||||
vrr_cursor_hz: None,
|
||||
};
|
||||
let data = Rc::new(ConnectorData {
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -1000,6 +1000,10 @@ impl OutputNode {
|
|||
.replace(use_native_gamut);
|
||||
if old != use_native_gamut {
|
||||
self.update_color_description();
|
||||
self.global
|
||||
.connector
|
||||
.head_managers
|
||||
.handle_use_native_gamut_change(use_native_gamut);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1007,6 +1011,10 @@ impl OutputNode {
|
|||
let old = self.global.persistent.blend_space.replace(blend_space);
|
||||
if old != blend_space {
|
||||
self.state.damage(self.global.position());
|
||||
self.global
|
||||
.connector
|
||||
.head_managers
|
||||
.handle_blend_space_change(blend_space);
|
||||
}
|
||||
}
|
||||
fn find_stacked_at(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue