backend: support outputs with arbitrary modes
This commit is contained in:
parent
dd10e1a585
commit
1a9753847a
23 changed files with 199 additions and 59 deletions
|
|
@ -16,7 +16,7 @@ use {
|
|||
},
|
||||
jay_config::video::{TearingMode as ConfigTearingMode, VrrMode as ConfigVrrMode},
|
||||
linearize::LinearizeExt,
|
||||
std::rc::Rc,
|
||||
std::{rc::Rc, slice},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
|
|
@ -36,6 +36,7 @@ const COLORIMETRY_SINCE: Version = Version(15);
|
|||
const BRIGHTNESS_SINCE: Version = Version(16);
|
||||
const BLEND_SPACE_SINCE: Version = Version(21);
|
||||
const NATIVE_GAMUT_SINCE: Version = Version(23);
|
||||
const ARBITRARY_MODES_SINCE: Version = Version(29);
|
||||
|
||||
impl JayRandr {
|
||||
pub fn new(id: JayRandrId, client: &Rc<Client>, version: Version) -> Self {
|
||||
|
|
@ -162,7 +163,11 @@ impl JayRandr {
|
|||
}
|
||||
}
|
||||
let current_mode = global.mode.get();
|
||||
for mode in &global.modes {
|
||||
for mode in global
|
||||
.modes
|
||||
.as_deref()
|
||||
.unwrap_or(slice::from_ref(¤t_mode))
|
||||
{
|
||||
self.client.event(Mode {
|
||||
self_id: self.id,
|
||||
width: mode.width,
|
||||
|
|
@ -232,6 +237,9 @@ impl JayRandr {
|
|||
self.client.event(UseNativeGamut { self_id: self.id });
|
||||
}
|
||||
}
|
||||
if self.version >= ARBITRARY_MODES_SINCE && global.modes.is_none() {
|
||||
self.client.event(ArbitraryModes { self_id: self.id });
|
||||
}
|
||||
}
|
||||
|
||||
fn send_error(&self, msg: &str) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue