add dpms on/off command
This commit is contained in:
parent
a29937ebe8
commit
2167484861
7 changed files with 76 additions and 13 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use {
|
||||
crate::{
|
||||
backend::transaction::BackendConnectorTransactionError,
|
||||
client::{CAP_JAY_COMPOSITOR, Client, ClientCaps, ClientError, ClientId},
|
||||
compositor::LogLevel,
|
||||
globals::{Global, GlobalName},
|
||||
|
|
@ -78,7 +79,7 @@ global_base!(JayCompositorGlobal, JayCompositor, JayCompositorError);
|
|||
|
||||
impl Global for JayCompositorGlobal {
|
||||
fn version(&self) -> u32 {
|
||||
30
|
||||
31
|
||||
}
|
||||
|
||||
fn required_caps(&self) -> ClientCaps {
|
||||
|
|
@ -542,6 +543,14 @@ impl JayCompositorRequestHandler for JayCompositor {
|
|||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn set_dpms(&self, req: SetDpms, _slf: &Rc<Self>) -> Result<(), Self::Error> {
|
||||
self.client
|
||||
.state
|
||||
.set_connectors_active(req.active != 0)
|
||||
.map_err(JayCompositorError::SetDpms)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
object_base! {
|
||||
|
|
@ -559,5 +568,7 @@ pub enum JayCompositorError {
|
|||
ClientError(Box<ClientError>),
|
||||
#[error("Unknown log level {0}")]
|
||||
UnknownLogLevel(u32),
|
||||
#[error("Could not set DPMS state")]
|
||||
SetDpms(#[source] BackendConnectorTransactionError),
|
||||
}
|
||||
efrom!(JayCompositorError, ClientError);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue