Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dash-frontend/assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"SCREEN_RENDER_DOWN_HELP": "Helps with aliasing on high-res screens",
"SCROLL_SPEED": "Scroll speed",
"SELECT_VARIANT": "Select variant",
"ENABLE_WATCH": "Enable watch",
"SETS_ON_WATCH": "Sets on watch",
"SKYBOX": "Skybox",
"SKYMAP_ALREADY_DOWNLOADED": "This skymap is already downloaded. Select desired action.",
Expand Down
1 change: 1 addition & 0 deletions dash-frontend/assets/lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"USE_SKYBOX_HELP": "Wyświetlaj niebo, jeśli nie ma aplikacji sceny lub passthrough",
"USE_PASSTHROUGH_HELP": "Pozwól na passthrough, jeśli runtime XR to obsługuje",
"SCREEN_RENDER_DOWN_HELP": "Pomaga redukować aliasing na ekranach o wysokiej rozdzielczości",
"ENABLE_WATCH": "Włącz zegarek",
"SETS_ON_WATCH": "Lista zestawów na zegarku",
"TROUBLESHOOTING": "Rozwiązywanie problemów",
"CLEAR_SAVED_STATE": "Wyczyść zapisany stan",
Expand Down
3 changes: 3 additions & 0 deletions dash-frontend/src/tab/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ enum SettingType {
PointerLerpFactor,
ScreenRenderDown,
ScrollSpeed,
EnableWatch,
SetsOnWatch,
SpaceDragMultiplier,
SpaceDragUnlocked,
Expand Down Expand Up @@ -309,6 +310,7 @@ impl SettingType {
Self::KeyboardSoundEnabled => &mut config.keyboard_sound_enabled,
Self::UprightScreenFix => &mut config.upright_screen_fix,
Self::DoubleCursorFix => &mut config.double_cursor_fix,
Self::EnableWatch => &mut config.enable_watch,
Self::SetsOnWatch => &mut config.sets_on_watch,
Self::HideGrabHelp => &mut config.hide_grab_help,
Self::AllowSliding => &mut config.allow_sliding,
Expand Down Expand Up @@ -435,6 +437,7 @@ impl SettingType {
Self::PointerLerpFactor => Ok("APP_SETTINGS.POINTER_LERP_FACTOR"),
Self::ScreenRenderDown => Ok("APP_SETTINGS.SCREEN_RENDER_DOWN"),
Self::ScrollSpeed => Ok("APP_SETTINGS.SCROLL_SPEED"),
Self::EnableWatch => Ok("APP_SETTINGS.ENABLE_WATCH"),
Self::SetsOnWatch => Ok("APP_SETTINGS.SETS_ON_WATCH"),
Self::SpaceDragMultiplier => Ok("APP_SETTINGS.SPACE_DRAG_MULTIPLIER"),
Self::SpaceDragUnlocked => Ok("APP_SETTINGS.SPACE_DRAG_UNLOCKED"),
Expand Down
2 changes: 1 addition & 1 deletion dash-frontend/src/tab/settings/tab_features.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::tab::settings::{
macros::{options_category, options_checkbox, options_range_f32, options_slider_f32},
SettingType, SettingsMountParams, SettingsTab,
macros::{options_category, options_checkbox, options_range_f32, options_slider_f32},
};

pub struct State {}
Expand Down
1 change: 1 addition & 0 deletions dash-frontend/src/tab/settings/tab_look_and_feel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ impl State {
options_slider_f32(par.mp, c, SettingType::UiAnimationSpeed, 0.5, 5.0, 0.1)?; // min, max, step
options_slider_f32(par.mp, c, SettingType::UiGradientIntensity, 0.0, 1.0, 0.05)?; // min, max, step
options_slider_f32(par.mp, c, SettingType::UiRoundMultiplier, 0.1, 5.0, 0.1)?;
options_checkbox(par.mp, c, SettingType::EnableWatch)?;
options_checkbox(par.mp, c, SettingType::SetsOnWatch)?;
options_checkbox(par.mp, c, SettingType::Clock12h)?;
Ok(State {})
Expand Down
13 changes: 11 additions & 2 deletions wayvr/src/backend/openxr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,12 @@ pub fn openxr_run(
app.hid_provider.inner.commit();

let watch = overlays.mut_by_id(watch_id).unwrap(); // want panic
if watch.config.active_state.is_none() {
watch.config.activate(&mut app);
}
let watch_state = watch.config.active_state.as_mut().unwrap();
let watch_transform = watch_state.transform;
if watch_state.alpha < 0.05 {
if watch_state.alpha < 0.05 || !app.session.config.enable_watch {
//FIXME: Temporary workaround for Monado bug
watch_state.transform = Affine3A::from_scale(Vec3 {
x: 0.001,
Expand Down Expand Up @@ -510,7 +513,13 @@ pub fn openxr_run(

//FIXME: Temporary workaround for Monado bug
let watch = overlays.mut_by_id(watch_id).unwrap(); // want panic
watch.config.active_state.as_mut().unwrap().transform = watch_transform;

if let Some(state) = watch.config.active_state.as_mut() {
state.transform = watch_transform
}
if !app.session.config.enable_watch {
watch.config.deactivate();
}
} // main_loop

if let (Some(blocker), Some(monado)) = (blocker, app.monado_state.as_mut()) {
Expand Down
2 changes: 2 additions & 0 deletions wayvr/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub struct AutoSettings {
pub keyboard_sound_enabled: bool,
pub upright_screen_fix: bool,
pub double_cursor_fix: bool,
pub enable_watch: bool,
pub sets_on_watch: bool,
pub hide_grab_help: bool,
pub xr_click_sensitivity: f32,
Expand Down Expand Up @@ -200,6 +201,7 @@ pub fn save_settings(config: &GeneralConfig) -> anyhow::Result<()> {
keyboard_sound_enabled: config.keyboard_sound_enabled,
upright_screen_fix: config.upright_screen_fix,
double_cursor_fix: config.double_cursor_fix,
enable_watch: config.enable_watch,
sets_on_watch: config.sets_on_watch,
hide_grab_help: config.hide_grab_help,
xr_click_sensitivity: config.xr_click_sensitivity,
Expand Down
2 changes: 1 addition & 1 deletion wayvr/src/overlays/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub fn create_watch(app: &mut AppState) -> anyhow::Result<OverlayWindowConfig> {
angle_fade: true,
..OverlayWindowState::default()
},
show_on_spawn: true,
show_on_spawn: app.session.config.enable_watch,
global: true,
..OverlayWindowConfig::from_backend(Box::new(panel))
})
Expand Down
3 changes: 3 additions & 0 deletions wayvr/src/res/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
# The settings are here for reference only.
# Probably don't include them in your config file.

## The watch will be enabled
#enable_watch: true

## The bottom of the watch will list sets instead of overlays.
#sets_on_watch: false

Expand Down
10 changes: 10 additions & 0 deletions wayvr/src/windowing/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,16 @@ where
self.sets_changed(app);
}
OverlayTask::SettingsChanged => {
if let Some(watch) = self.mut_by_id(self.watch_id) {
if app.session.config.enable_watch != watch.config.active_state.is_some() {
if watch.config.active_state.is_some() {
watch.config.deactivate();
} else {
watch.config.activate(app);
}
}
}

for o in self.overlays.values_mut() {
let _ = o
.config
Expand Down
3 changes: 3 additions & 0 deletions wlx-common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ pub struct GeneralConfig {
#[serde(default = "def_false")]
pub double_cursor_fix: bool,

#[serde(default = "def_true")]
pub enable_watch: bool,

#[serde(default = "def_false")]
pub sets_on_watch: bool,

Expand Down
Loading