feat(wayland): virtual output
This commit is contained in:
@@ -5,12 +5,33 @@ use waynest::{
|
|||||||
|
|
||||||
pub use waynest::server::protocol::core::wayland::wl_output::*;
|
pub use waynest::server::protocol::core::wayland::wl_output::*;
|
||||||
|
|
||||||
#[derive(Debug, Dispatcher, Default)]
|
#[derive(Debug, Dispatcher)]
|
||||||
pub struct Output;
|
pub struct Output(pub ObjectId);
|
||||||
|
impl Output {
|
||||||
|
pub async fn advertise_outputs(&self, client: &mut Client) -> Result<()> {
|
||||||
|
self.geometry(
|
||||||
|
client,
|
||||||
|
self.0,
|
||||||
|
2048,
|
||||||
|
2048,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
Subpixel::None,
|
||||||
|
"Stardust Virtual Display".to_string(),
|
||||||
|
"Stardust Virtual Display".to_string(),
|
||||||
|
Transform::Normal,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
self.mode(client, self.0, Mode::Current, 2048, 2048, 0)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
self.done(client, self.0).await
|
||||||
|
}
|
||||||
|
}
|
||||||
impl WlOutput for Output {
|
impl WlOutput for Output {
|
||||||
/// https://wayland.app/protocols/wayland#wl_output:request:release
|
/// https://wayland.app/protocols/wayland#wl_output:request:release
|
||||||
async fn release(&self, _client: &mut Client, _sender_id: ObjectId) -> Result<()> {
|
async fn release(&self, _client: &mut Client, _sender_id: ObjectId) -> Result<()> {
|
||||||
todo!()
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,8 @@ impl WlRegistry for Registry {
|
|||||||
}
|
}
|
||||||
RegistryGlobals::OUTPUT => {
|
RegistryGlobals::OUTPUT => {
|
||||||
tracing::info!("Binding output");
|
tracing::info!("Binding output");
|
||||||
client.insert(new_id.object_id, Output);
|
let output = client.insert(new_id.object_id, Output(new_id.object_id));
|
||||||
|
output.advertise_outputs(client).await?;
|
||||||
}
|
}
|
||||||
RegistryGlobals::DMABUF => {
|
RegistryGlobals::DMABUF => {
|
||||||
tracing::info!("Binding dmabuf");
|
tracing::info!("Binding dmabuf");
|
||||||
|
|||||||
Reference in New Issue
Block a user