video: send feedback when brightness changes
This commit is contained in:
parent
0ec3cdf608
commit
28cfa6a11f
4 changed files with 12 additions and 9 deletions
|
|
@ -1132,7 +1132,7 @@ impl ConfigProxyHandler {
|
||||||
brightness: Option<f64>,
|
brightness: Option<f64>,
|
||||||
) -> Result<(), CphError> {
|
) -> Result<(), CphError> {
|
||||||
let connector = self.get_output_node(connector)?;
|
let connector = self.get_output_node(connector)?;
|
||||||
connector.global.set_brightness(brightness);
|
connector.set_brightness(brightness);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -486,7 +486,7 @@ impl JayRandrRequestHandler for JayRandr {
|
||||||
let Some(c) = self.get_output_node(req.output) else {
|
let Some(c) = self.get_output_node(req.output) else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
c.global.set_brightness(Some(req.lux));
|
c.set_brightness(Some(req.lux));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -498,7 +498,7 @@ impl JayRandrRequestHandler for JayRandr {
|
||||||
let Some(c) = self.get_output_node(req.output) else {
|
let Some(c) = self.get_output_node(req.output) else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
c.global.set_brightness(None);
|
c.set_brightness(None);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -381,12 +381,6 @@ impl WlOutputGlobal {
|
||||||
self.linear_color_description.set(cd_linear.clone());
|
self.linear_color_description.set(cd_linear.clone());
|
||||||
self.color_description.set(cd.clone()).id != cd.id
|
self.color_description.set(cd.clone()).id != cd.id
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_brightness(&self, brightness: Option<f64>) {
|
|
||||||
self.persistent.brightness.set(brightness);
|
|
||||||
self.update_color_description();
|
|
||||||
self.state.damage(self.pos.get());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
global_base!(WlOutputGlobal, WlOutput, WlOutputError);
|
global_base!(WlOutputGlobal, WlOutput, WlOutputError);
|
||||||
|
|
|
||||||
|
|
@ -844,6 +844,10 @@ impl OutputNode {
|
||||||
if (old_btf, old_bcs) == (btf, bcs) {
|
if (old_btf, old_bcs) == (btf, bcs) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
self.update_color_description();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update_color_description(&self) {
|
||||||
if self.global.update_color_description() {
|
if self.global.update_color_description() {
|
||||||
self.state.damage(self.global.position());
|
self.state.damage(self.global.position());
|
||||||
if let Some(hc) = self.hardware_cursor.get() {
|
if let Some(hc) = self.hardware_cursor.get() {
|
||||||
|
|
@ -857,6 +861,11 @@ impl OutputNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_brightness(&self, brightness: Option<f64>) {
|
||||||
|
self.global.persistent.brightness.set(brightness);
|
||||||
|
self.update_color_description();
|
||||||
|
}
|
||||||
|
|
||||||
fn find_stacked_at(
|
fn find_stacked_at(
|
||||||
&self,
|
&self,
|
||||||
stack: &LinkedList<Rc<dyn StackedNode>>,
|
stack: &LinkedList<Rc<dyn StackedNode>>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue