backend: support outputs with arbitrary modes
This commit is contained in:
parent
dd10e1a585
commit
1a9753847a
23 changed files with 199 additions and 59 deletions
|
|
@ -1191,6 +1191,19 @@ impl ConfigClient {
|
|||
modes.into_iter().map(WireMode::to_mode).collect()
|
||||
}
|
||||
|
||||
pub fn connector_supports_arbitrary_modes(&self, connector: Connector) -> bool {
|
||||
let res =
|
||||
self.send_with_response(&ClientMessage::ConnectorSupportsArbitraryModes { connector });
|
||||
get_response!(
|
||||
res,
|
||||
false,
|
||||
ConnectorSupportsArbitraryModes {
|
||||
supports_arbitrary_modes
|
||||
}
|
||||
);
|
||||
supports_arbitrary_modes
|
||||
}
|
||||
|
||||
pub fn connector_size(&self, connector: Connector) -> (i32, i32) {
|
||||
let res = self.send_with_response(&ClientMessage::ConnectorSize { connector });
|
||||
get_response!(res, (0, 0), ConnectorSize { width, height });
|
||||
|
|
|
|||
|
|
@ -846,6 +846,9 @@ pub enum ClientMessage<'a> {
|
|||
monospace: Option<Vec<&'a str>>,
|
||||
},
|
||||
OpenControlCenter,
|
||||
ConnectorSupportsArbitraryModes {
|
||||
connector: Connector,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
@ -1096,6 +1099,9 @@ pub enum Response {
|
|||
KeymapFromNames {
|
||||
keymap: Keymap,
|
||||
},
|
||||
ConnectorSupportsArbitraryModes {
|
||||
supports_arbitrary_modes: bool,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
|
|||
|
|
@ -157,6 +157,14 @@ impl Connector {
|
|||
get!(Vec::new()).connector_modes(self)
|
||||
}
|
||||
|
||||
/// Returns whether this connector supports arbitrary modes.
|
||||
pub fn supports_arbitrary_modes(self) -> bool {
|
||||
if !self.exists() {
|
||||
return false;
|
||||
}
|
||||
get!(false).connector_supports_arbitrary_modes(self)
|
||||
}
|
||||
|
||||
/// Returns the logical width of the connector.
|
||||
///
|
||||
/// The returned value will be different from `mode().width()` if the scale is not 1.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue