1
0
Fork 0
forked from wry/wry

virtual-output: add support for virtual outputs

This commit is contained in:
Julian Orth 2026-03-17 18:42:49 +01:00
parent c25d17514d
commit 530e66ef78
27 changed files with 1480 additions and 9 deletions

View file

@ -78,7 +78,7 @@ global_base!(JayCompositorGlobal, JayCompositor, JayCompositorError);
impl Global for JayCompositorGlobal {
fn version(&self) -> u32 {
29
30
}
fn required_caps(&self) -> ClientCaps {

View file

@ -270,6 +270,11 @@ impl JayRandr {
}
fn get_connector(&self, name: &str) -> Option<Rc<ConnectorData>> {
for c in self.client.state.connectors.lock().values() {
if *c.name == name {
return Some(c.clone());
}
}
let namelc = name.to_ascii_lowercase();
for c in self.client.state.connectors.lock().values() {
if c.name.to_ascii_lowercase() == namelc {
@ -281,6 +286,11 @@ impl JayRandr {
}
fn get_output(&self, name: &str) -> Option<Rc<OutputData>> {
for c in self.client.state.outputs.lock().values() {
if *c.connector.name == name {
return Some(c.clone());
}
}
let namelc = name.to_ascii_lowercase();
for c in self.client.state.outputs.lock().values() {
if c.connector.name.to_ascii_lowercase() == namelc {
@ -588,6 +598,28 @@ impl JayRandrRequestHandler for JayRandr {
c.set_use_native_gamut(req.use_native_gamut != 0);
Ok(())
}
fn create_virtual_output(
&self,
req: CreateVirtualOutput<'_>,
_slf: &Rc<Self>,
) -> Result<(), Self::Error> {
self.state
.virtual_outputs
.get_or_create(&self.state, req.name);
Ok(())
}
fn remove_virtual_output(
&self,
req: RemoveVirtualOutput<'_>,
_slf: &Rc<Self>,
) -> Result<(), Self::Error> {
self.state
.virtual_outputs
.remove_output(&self.state, req.name);
Ok(())
}
}
object_base! {

View file

@ -62,7 +62,6 @@ pub struct WpPresentationFeedback {
}
pub const KIND_VSYNC: u32 = 0x1;
#[expect(dead_code)]
pub const KIND_HW_CLOCK: u32 = 0x2;
pub const KIND_HW_COMPLETION: u32 = 0x4;
pub const KIND_ZERO_COPY: u32 = 0x8;