Merge Staging into main (#130)
* config: add use_passthrough * do not use ALPHA_BLEND if passthrough is off * keyboard.yaml auto_labels * OSC: Finish XSOverlay parity (#124) * osc-battery - utilise match return value to set parameter this just lets parameter be a `&str` instead of a `String`, and reduces repetition. * osc-battery - fix error where trackers were 1-indexed instead of 0-indexed * osc-battery: xsoverlay parity! add average tracker and controller battery parameters. this should now be in parity with xsoverlay's parameters. gone back to 1-indexing trackers because it's more user-friendly, so other programs can standardise more easily. * osc battery: ...that was not 1-indexed. no idea how I made that mistake but the sent tracker parameters were actually still 0-indexed. * Update Envision section (#123) add directions for appimage autostart * Add Flatpak instructions (#127) * Add Flatpak instructions fix small inconsistencies between instructions * Clarify Flatpak Steam setup for SteamVR and Monado/WiVRn users * Additional instructions * default AltLayout is None * WayVR: IPC [1]: Local socket server, handshake receiver * WayVR : IPC [2]: `ListDisplays`, `GetDisplay` commands * WayVR: IPC [3]: `ListProcesses`, `TerminateProcess` commands * WayVR: IPC [4]: Minor refactoring * WayVR: Move IPC to separate Git repository * Restore default features in Cargo.toml * WayVR: Implement `WvrDisplayCreate`, Implement `WvrProcessLaunch`, Refactoring * WayVR: Dashboard toggle support, minor refactoring * Update Cargo.toml * fix formatting for openxr_actions.json5 --------- Co-authored-by: galister <22305755+galister@users.noreply.github.com> Co-authored-by: Jay <157681441+cubee-cb@users.noreply.github.com> Co-authored-by: Marcus Howser <mhowser.git@mailbox.org> Co-authored-by: Joshua Vandaële <joshua@vandaele.software>
This commit is contained in:
@@ -17,7 +17,7 @@ use crate::{
|
||||
wayvr,
|
||||
},
|
||||
config::{load_known_yaml, ConfigType},
|
||||
overlays::wayvr::{WayVRAction, WayVRState},
|
||||
overlays::wayvr::{WayVRAction, WayVRData},
|
||||
};
|
||||
|
||||
// Flat version of RelativeTo
|
||||
@@ -40,6 +40,16 @@ impl AttachTo {
|
||||
AttachTo::Head => RelativeTo::Head,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_packet(input: &wayvr_ipc::packet_client::AttachTo) -> AttachTo {
|
||||
match input {
|
||||
wayvr_ipc::packet_client::AttachTo::None => AttachTo::None,
|
||||
wayvr_ipc::packet_client::AttachTo::HandLeft => AttachTo::HandLeft,
|
||||
wayvr_ipc::packet_client::AttachTo::HandRight => AttachTo::HandRight,
|
||||
wayvr_ipc::packet_client::AttachTo::Head => AttachTo::Head,
|
||||
wayvr_ipc::packet_client::AttachTo::Stage => AttachTo::Stage,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
@@ -60,8 +70,8 @@ pub struct WayVRAppEntry {
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub struct WayVRDisplay {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub width: u16,
|
||||
pub height: u16,
|
||||
pub scale: Option<f32>,
|
||||
pub rotation: Option<Rotation>,
|
||||
pub pos: Option<[f32; 3]>,
|
||||
@@ -96,12 +106,20 @@ fn def_keyboard_repeat_rate() -> u32 {
|
||||
50
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct WayVRDashboard {
|
||||
pub exec: String,
|
||||
pub args: Option<String>,
|
||||
pub env: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct WayVRConfig {
|
||||
pub version: u32,
|
||||
pub run_compositor_at_start: bool,
|
||||
pub catalogs: HashMap<String, WayVRCatalog>,
|
||||
pub displays: BTreeMap<String, WayVRDisplay>, // sorted alphabetically
|
||||
pub dashboard: WayVRDashboard,
|
||||
|
||||
#[serde(default = "def_true")]
|
||||
pub auto_hide: bool,
|
||||
@@ -154,7 +172,7 @@ impl WayVRConfig {
|
||||
&self,
|
||||
config: &crate::config::GeneralConfig,
|
||||
tasks: &mut TaskContainer,
|
||||
) -> anyhow::Result<Option<Rc<RefCell<WayVRState>>>> {
|
||||
) -> anyhow::Result<Option<Rc<RefCell<WayVRData>>>> {
|
||||
let primary_count = self
|
||||
.displays
|
||||
.iter()
|
||||
@@ -182,8 +200,8 @@ impl WayVRConfig {
|
||||
|
||||
if self.run_compositor_at_start {
|
||||
// Start Wayland server instantly
|
||||
Ok(Some(Rc::new(RefCell::new(WayVRState::new(
|
||||
Self::get_wayvr_config(config, &self),
|
||||
Ok(Some(Rc::new(RefCell::new(WayVRData::new(
|
||||
Self::get_wayvr_config(config, self),
|
||||
)?))))
|
||||
} else {
|
||||
// Lazy-init WayVR later if the user requested
|
||||
|
||||
Reference in New Issue
Block a user