WayVR: Add DashboardShown and DashboardHidden events, add WlxInputState support (#167)

Wlx: Fix various Clippy warnings
This commit is contained in:
Aleksander
2025-02-28 22:05:27 +01:00
committed by GitHub
parent e66a8d27c9
commit 075e55a8e8
11 changed files with 73 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
use glam::{vec3a, Affine2, Vec3, Vec3A};
use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc};
use vulkano::image::SubresourceLayout;
use wayvr_ipc::packet_server;
use wayvr_ipc::packet_server::{self, PacketServer, WvrStateChanged};
use wlx_capture::frame::{DmabufFrame, FourCC, FrameFormat, FramePlane};
use crate::{
@@ -332,12 +332,23 @@ where
anyhow::bail!("Overlay ID not set for dashboard display");
};
let cur_visibility = !display.visible;
wayvr
.data
.ipc_server
.broadcast(PacketServer::WvrStateChanged(if cur_visibility {
WvrStateChanged::DashboardShown
} else {
WvrStateChanged::DashboardHidden
}));
app.tasks.enqueue(TaskType::Overlay(
OverlaySelector::Id(overlay_id),
Box::new(move |app, o| {
// Toggle visibility
o.want_visible = !o.want_visible;
if o.want_visible {
o.want_visible = cur_visibility;
if cur_visibility {
o.reset(app, true);
}
}),
@@ -447,12 +458,12 @@ where
wayvr
.data
.ipc_server
.broadcast(packet_server::PacketServer::WvrStateChanged(packet))?;
.broadcast(packet_server::PacketServer::WvrStateChanged(packet));
}
}
}
let res = wayvr.data.tick_events()?;
let res = wayvr.data.tick_events(app)?;
drop(wayvr);
for result in res {