mirror of https://github.com/wayvr-org/wayvr.git
previous commit broke monado workaround, this fixes it
This commit is contained in:
parent
ae698bf111
commit
98a4f5eeb8
|
|
@ -0,0 +1,10 @@
|
|||
<!-- FIXME: Temporary workaround for Monado bug, this entire file should be deleted once that's resolved -->
|
||||
<layout>
|
||||
<elements>
|
||||
<rectangle
|
||||
width="1"
|
||||
height="1"
|
||||
color="~color_accent">
|
||||
</rectangle>
|
||||
</elements>
|
||||
</layout>
|
||||
|
|
@ -5,7 +5,6 @@ use std::{
|
|||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
use glam::{Affine3A, Vec3};
|
||||
use input::OpenXrInputSource;
|
||||
use openxr as xr;
|
||||
use skybox::{Skybox, create_skybox};
|
||||
|
|
@ -22,7 +21,7 @@ use crate::{
|
|||
},
|
||||
config::{save_settings, save_state},
|
||||
graphics::{GpuFutures, init_openxr_graphics},
|
||||
overlays::{toast::Toast, watch::WATCH_NAME},
|
||||
overlays::toast::Toast,
|
||||
state::AppState,
|
||||
subsystem::notifications::NotificationManager,
|
||||
windowing::{
|
||||
|
|
@ -141,8 +140,6 @@ pub fn openxr_run(
|
|||
lines.allocate(&xr_state, &app)?,
|
||||
];
|
||||
|
||||
let watch_id = overlays.lookup(WATCH_NAME);
|
||||
|
||||
let mut input_source = input::OpenXrInputSource::new(&xr_state)?;
|
||||
|
||||
let mut session_running = false;
|
||||
|
|
@ -345,21 +342,6 @@ pub fn openxr_run(
|
|||
|
||||
app.hid_provider.inner.commit();
|
||||
|
||||
let mut watch_transform = Affine3A::IDENTITY;
|
||||
if let Some(watch) = watch_id.and_then(|id| overlays.mut_by_id(id)) {
|
||||
let watch_state = watch.config.active_state.as_mut().unwrap();
|
||||
watch_transform = watch_state.transform;
|
||||
if watch_state.alpha < 0.05 {
|
||||
//FIXME: Temporary workaround for Monado bug
|
||||
watch_state.transform = Affine3A::from_scale(Vec3 {
|
||||
x: 0.001,
|
||||
y: 0.001,
|
||||
z: 0.001,
|
||||
});
|
||||
watch_state.alpha = 0.02; // visible but not really. Monado freaks out if no layers are submitted.
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(e) =
|
||||
crate::ipc::events::tick_events::<OpenXrOverlayData>(&mut app, &mut overlays)
|
||||
{
|
||||
|
|
@ -509,11 +491,6 @@ pub fn openxr_run(
|
|||
}
|
||||
|
||||
delete_queue.retain(|(_, frame)| *frame > cur_frame);
|
||||
|
||||
//FIXME: Temporary workaround for Monado bug
|
||||
if let Some(watch) = watch_id.and_then(|id| overlays.mut_by_id(id)) {
|
||||
watch.config.active_state.as_mut().unwrap().transform = watch_transform;
|
||||
}
|
||||
} // main_loop
|
||||
|
||||
if let (Some(blocker), Some(monado)) = (blocker, app.monado_state.as_mut()) {
|
||||
|
|
|
|||
|
|
@ -5,20 +5,17 @@ use std::{
|
|||
};
|
||||
|
||||
use anyhow::Context;
|
||||
use glam::{Affine3A, Vec3, Vec3A};
|
||||
use glam::{Affine3A, Quat, Vec3, Vec3A};
|
||||
use slotmap::{Key, SecondaryMap, SlotMap};
|
||||
use wgui::log::LogErr;
|
||||
use wlx_common::{
|
||||
astr_containers::{AStrMap, AStrMapExt},
|
||||
config::SerializedWindowSet,
|
||||
overlays::{BackendAttrib, BackendAttribValue, ToastTopic},
|
||||
overlays::{BackendAttrib, BackendAttribValue, ToastTopic}, windowing::{OverlayWindowState, Positioning},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
FRAME_COUNTER,
|
||||
backend::task::{OverlayTask, ToggleMode},
|
||||
config::save_state,
|
||||
overlays::{
|
||||
FRAME_COUNTER, backend::task::{OverlayTask, ToggleMode}, config::save_state, gui::panel::{GuiPanel, NewGuiPanelParams}, overlays::{
|
||||
anchor::{create_anchor, create_grab_help},
|
||||
custom::create_custom,
|
||||
dashboard::{DASH_NAME, create_dash_frontend},
|
||||
|
|
@ -27,17 +24,16 @@ use crate::{
|
|||
screen::create_screens,
|
||||
toast::Toast,
|
||||
watch::{WATCH_NAME, create_watch},
|
||||
},
|
||||
state::AppState,
|
||||
windowing::{
|
||||
}, state::AppState, windowing::{
|
||||
OverlayID, OverlaySelector,
|
||||
backend::{OverlayEventData, OverlayMeta},
|
||||
set::OverlayWindowSet,
|
||||
snap_upright,
|
||||
window::{OverlayCategory, OverlayWindowData},
|
||||
},
|
||||
window::{OverlayCategory, OverlayWindowConfig, OverlayWindowData},
|
||||
}
|
||||
};
|
||||
|
||||
pub const DUMMY_NAME: &str = "FIXME: Temporary workaround for Monado bug";
|
||||
pub const MAX_OVERLAY_SETS: usize = 6;
|
||||
|
||||
pub struct OverlayWindowManager<T> {
|
||||
|
|
@ -126,6 +122,29 @@ where
|
|||
|
||||
let anchor = OverlayWindowData::from_config(create_anchor(app)?);
|
||||
me.add(anchor, app);
|
||||
|
||||
// FIXME: Temporary workaround for Monado bug
|
||||
// Monado freaks out if no layers are submitted.
|
||||
// This creates a panel which is behind your head and is very tiny so you should never be able to see it.
|
||||
let mut panel =
|
||||
GuiPanel::new_from_template(app, "gui/dummy.xml", (), NewGuiPanelParams::default()).unwrap();
|
||||
panel.update_layout(app)?;
|
||||
let dummy = OverlayWindowData::from_config(OverlayWindowConfig {
|
||||
name: DUMMY_NAME.into(),
|
||||
z_order: u32::MIN,
|
||||
category: OverlayCategory::Internal,
|
||||
default_state: OverlayWindowState {
|
||||
grabbable: false,
|
||||
interactable: false,
|
||||
positioning: Positioning::FollowHead { lerp: 1.0 },
|
||||
transform: Affine3A::from_scale_rotation_translation(Vec3::ONE * 0.001, Quat::IDENTITY, Vec3::Z),
|
||||
..OverlayWindowState::default()
|
||||
},
|
||||
show_on_spawn: true,
|
||||
global: true,
|
||||
..OverlayWindowConfig::from_backend(Box::new(panel))
|
||||
});
|
||||
me.add(dummy, app);
|
||||
|
||||
if app.session.config.enable_watch {
|
||||
let watch = OverlayWindowData::from_config(create_watch(app)?);
|
||||
|
|
|
|||
Loading…
Reference in New Issue