config: add Connector::set_enabled
This commit is contained in:
parent
4bbca6abdc
commit
30aa6de35c
8 changed files with 61 additions and 4 deletions
|
|
@ -440,6 +440,10 @@ impl Client {
|
|||
self.send(&ClientMessage::ConnectorSetPosition { connector, x, y });
|
||||
}
|
||||
|
||||
pub fn connector_set_enabled(&self, connector: Connector, enabled: bool) {
|
||||
self.send(&ClientMessage::ConnectorSetEnabled { connector, enabled });
|
||||
}
|
||||
|
||||
pub fn device_connectors(&self, device: DrmDevice) -> Vec<Connector> {
|
||||
let res = self.send_with_response(&ClientMessage::GetDeviceConnectors { device });
|
||||
get_response!(res, vec![], GetDeviceConnectors { connectors });
|
||||
|
|
|
|||
|
|
@ -308,6 +308,10 @@ pub enum ClientMessage<'a> {
|
|||
DisablePointerConstraint {
|
||||
seat: Seat,
|
||||
},
|
||||
ConnectorSetEnabled {
|
||||
connector: Connector,
|
||||
enabled: bool,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Encode, Decode, Debug)]
|
||||
|
|
|
|||
|
|
@ -147,6 +147,17 @@ impl Connector {
|
|||
}
|
||||
get!().connector_set_position(self, x, y);
|
||||
}
|
||||
|
||||
/// Enables or disables the connector.
|
||||
///
|
||||
/// By default, all connectors are enabled.
|
||||
pub fn set_enabled(self, enabled: bool) {
|
||||
if !self.exists() {
|
||||
log::warn!("set_enabled called on a connector that does not exist");
|
||||
return;
|
||||
}
|
||||
get!().connector_set_enabled(self, enabled);
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns all available DRM devices.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue