add flatpak manifest
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use anyhow::{bail, ensure};
|
||||
use glam::{Affine3A, Quat, Vec3, Vec3A};
|
||||
use openxr::{self as xr, SessionCreateFlags};
|
||||
use openxr::{self as xr, SessionCreateFlags, Version};
|
||||
use xr::OverlaySessionCreateFlagsEXTX;
|
||||
|
||||
pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
|
||||
@@ -54,6 +54,7 @@ pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
|
||||
|
||||
let Ok(xr_instance) = entry.create_instance(
|
||||
&xr::ApplicationInfo {
|
||||
api_version: Version::new(1, 1, 37),
|
||||
application_name: "wlx-overlay-s",
|
||||
application_version: 0,
|
||||
engine_name: "wlx-overlay-s",
|
||||
|
||||
19
src/main.rs
19
src/main.rs
@@ -34,6 +34,7 @@ use std::{
|
||||
},
|
||||
};
|
||||
|
||||
use backend::notifications::DbusNotificationSender;
|
||||
use clap::Parser;
|
||||
use sysinfo::Pid;
|
||||
use tracing::level_filters::LevelFilter;
|
||||
@@ -127,12 +128,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(unused_mut)]
|
||||
fn auto_run(running: Arc<AtomicBool>, args: Args) {
|
||||
use backend::common::BackendError;
|
||||
|
||||
let mut tried_xr = false;
|
||||
let mut tried_vr = false;
|
||||
|
||||
#[cfg(feature = "openxr")]
|
||||
if !args_get_openvr(&args) {
|
||||
use crate::backend::openxr::openxr_run;
|
||||
tried_xr = true;
|
||||
match openxr_run(running.clone(), args.show) {
|
||||
Ok(()) => return,
|
||||
Err(BackendError::NotSupported) => (),
|
||||
@@ -146,6 +152,7 @@ fn auto_run(running: Arc<AtomicBool>, args: Args) {
|
||||
#[cfg(feature = "openvr")]
|
||||
if !args_get_openxr(&args) {
|
||||
use crate::backend::openvr::openvr_run;
|
||||
tried_vr = true;
|
||||
match openvr_run(running, args.show) {
|
||||
Ok(()) => return,
|
||||
Err(BackendError::NotSupported) => (),
|
||||
@@ -158,6 +165,18 @@ fn auto_run(running: Arc<AtomicBool>, args: Args) {
|
||||
|
||||
log::error!("No more backends to try");
|
||||
|
||||
let instructions = match (tried_xr, tried_vr) {
|
||||
(true, true) => "Make sure that Monado, WiVRn or SteamVR is running.",
|
||||
(false, true) => "Make sure that SteamVR is running.",
|
||||
(true, false) => "Make sure that Monado or WiVRn is running.",
|
||||
_ => "Check your launch arguments.",
|
||||
};
|
||||
|
||||
let instructions = format!("Could not connect to runtime.\n{instructions}");
|
||||
|
||||
let _ = DbusNotificationSender::new()
|
||||
.and_then(|s| s.notify_send("WlxOverlay-S", &instructions, 1, 0, 0, false));
|
||||
|
||||
#[cfg(not(any(feature = "openvr", feature = "openxr")))]
|
||||
compile_error!("No VR support! Enable either openvr or openxr features!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user