diff --git a/dash-frontend/assets/gui/tab/monado_tab_general_settings.xml b/dash-frontend/assets/gui/tab/monado_tab_general_settings.xml
index 3d918b82..c99cbf21 100644
--- a/dash-frontend/assets/gui/tab/monado_tab_general_settings.xml
+++ b/dash-frontend/assets/gui/tab/monado_tab_general_settings.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/dash-frontend/src/tab/games.rs b/dash-frontend/src/tab/games.rs
index 02082ef7..514b7c3e 100644
--- a/dash-frontend/src/tab/games.rs
+++ b/dash-frontend/src/tab/games.rs
@@ -27,12 +27,20 @@ impl Tab for TabGames {
TabType::Games
}
- fn update(&mut self, frontend: &mut Frontend, time_ms: u32, _data: &mut T) -> anyhow::Result<()> {
+ fn update(&mut self, frontend: &mut Frontend, time_ms: u32, data: &mut T) -> anyhow::Result<()> {
+ let mut config_change_kind = None;
+
self.view_game_list.update(&mut ViewUpdateParams {
layout: &mut frontend.layout,
- executor: &mut frontend.executor,
+ executor: &frontend.executor,
+ general_config: frontend.interface.general_config(data),
+ config_change_kind: &mut config_change_kind,
})?;
+ if let Some(kind) = config_change_kind {
+ frontend.interface.config_changed(data, kind);
+ }
+
self.view_running_games_list.update(&mut frontend.layout, time_ms)?;
Ok(())
}
diff --git a/dash-frontend/src/tab/monado.rs b/dash-frontend/src/tab/monado.rs
index 4a9d1b95..ade22f89 100644
--- a/dash-frontend/src/tab/monado.rs
+++ b/dash-frontend/src/tab/monado.rs
@@ -175,7 +175,9 @@ impl Tab for TabMonado {
Task::GeneralSettingsChromaUpdate => {
if let Subtab::GeneralSettings(tab) = &mut self.subtab {
tab.chroma_update(frontend.interface.general_config(data));
- frontend.interface.config_changed(data, ConfigChangeKind::EnvironmentBlend);
+ frontend
+ .interface
+ .config_changed(data, ConfigChangeKind::EnvironmentBlend);
}
}
Task::SetBrightness(brightness) => self.set_brightness(frontend, data, brightness),
diff --git a/dash-frontend/src/tab/settings/mod.rs b/dash-frontend/src/tab/settings/mod.rs
index fe539b59..f6e09be8 100644
--- a/dash-frontend/src/tab/settings/mod.rs
+++ b/dash-frontend/src/tab/settings/mod.rs
@@ -19,7 +19,11 @@ use wgui::{
},
windowing::context_menu::{self, Blueprint, ContextMenu, TickResult},
};
-use wlx_common::{config::GeneralConfig, config_io::ConfigRoot, dash_interface::{ConfigChangeKind, RecenterMode}};
+use wlx_common::{
+ config::GeneralConfig,
+ config_io::ConfigRoot,
+ dash_interface::{ConfigChangeKind, RecenterMode},
+};
use crate::{
frontend::{Frontend, FrontendTask, FrontendTasks},
@@ -110,13 +114,21 @@ impl Tab for TabSettings {
fn update(&mut self, frontend: &mut Frontend, _time_ms: u32, data: &mut T) -> anyhow::Result<()> {
if let Some(tab) = &mut self.current_tab {
+ let mut config_change_kind = None;
+
tab.update(&mut ViewUpdateParams {
layout: &mut frontend.layout,
executor: &frontend.executor,
+ general_config: frontend.interface.general_config(data),
+ config_change_kind: &mut config_change_kind,
})?;
+
+ if let Some(kind) = config_change_kind {
+ frontend.interface.config_changed(data, kind);
+ }
}
- let mut changed = false;
+ let mut changed = None;
for task in self.tasks.drain() {
match task {
Task::SetTab(tab) => {
@@ -129,7 +141,7 @@ impl Tab for TabSettings {
}
let config = frontend.interface.general_config(data);
*setting.mut_bool(config) = n;
- changed = true;
+ changed = Some(setting.change_kind());
}
Task::UpdateFloat(setting, n) => {
self.tasks.push(Task::SettingUpdated(setting));
@@ -138,7 +150,7 @@ impl Tab for TabSettings {
}
let config = frontend.interface.general_config(data);
*setting.mut_f32(config) = n;
- changed = true;
+ changed = Some(setting.change_kind());
}
Task::UpdateInt(setting, n) => {
self.tasks.push(Task::SettingUpdated(setting));
@@ -147,7 +159,7 @@ impl Tab for TabSettings {
}
let config = frontend.interface.general_config(data);
*setting.mut_i32(config) = n;
- changed = true;
+ changed = Some(setting.change_kind());
}
Task::ClearPipewireTokens => {
let _ = std::fs::remove_file(ConfigRoot::Generic.get_conf_d_path().join("pw_tokens.yaml"))
@@ -186,7 +198,7 @@ impl Tab for TabSettings {
let config = frontend.interface.general_config(data);
config.autostart_apps.remove(idx);
frontend.layout.remove_widget(widget);
- changed = true;
+ changed = Some(ConfigChangeKind::OverlayConfig);
}
}
Task::SettingUpdated(setting) => match setting {
@@ -219,12 +231,12 @@ impl Tab for TabSettings {
let setting = SettingType::from_str(setting).expect("Invalid Enum string");
let config = frontend.interface.general_config(data);
setting.set_enum(config, value);
- changed = true;
+ changed = Some(ConfigChangeKind::OverlayConfig);
}
// Notify overlays of the change
- if changed {
- frontend.interface.config_changed(data, ConfigChangeKind::OverlayConfig);
+ if let Some(changed) = changed {
+ frontend.interface.config_changed(data, changed);
}
Ok(())
@@ -277,6 +289,13 @@ enum SettingType {
}
impl SettingType {
+ pub fn change_kind(self) -> ConfigChangeKind {
+ match self {
+ Self::UseSkybox | Self::UsePassthrough => ConfigChangeKind::EnvironmentBlend,
+ _ => ConfigChangeKind::OverlayConfig,
+ }
+ }
+
pub fn mut_bool(self, config: &mut GeneralConfig) -> &mut bool {
match self {
Self::InvertScrollDirectionX => &mut config.invert_scroll_direction_x,
diff --git a/dash-frontend/src/tab/settings/tab_features.rs b/dash-frontend/src/tab/settings/tab_features.rs
index 2269069e..992bf06c 100644
--- a/dash-frontend/src/tab/settings/tab_features.rs
+++ b/dash-frontend/src/tab/settings/tab_features.rs
@@ -1,6 +1,6 @@
use crate::tab::settings::{
- macros::{options_category, options_checkbox, options_slider_f32},
SettingType, SettingsMountParams, SettingsTab,
+ macros::{options_category, options_checkbox, options_slider_f32},
};
pub struct State {}
diff --git a/dash-frontend/src/views/mod.rs b/dash-frontend/src/views/mod.rs
index 91cdee11..918c67fc 100644
--- a/dash-frontend/src/views/mod.rs
+++ b/dash-frontend/src/views/mod.rs
@@ -1,4 +1,4 @@
-use wlx_common::async_executor::AsyncExecutor;
+use wlx_common::{async_executor::AsyncExecutor, config::GeneralConfig, dash_interface::ConfigChangeKind};
pub mod app_launcher;
pub mod audio_settings;
@@ -16,6 +16,8 @@ pub mod skymap_list_cell;
pub struct ViewUpdateParams<'a> {
pub layout: &'a mut wgui::layout::Layout,
pub executor: &'a AsyncExecutor,
+ pub general_config: &'a mut GeneralConfig,
+ pub config_change_kind: &'a mut Option,
}
pub trait ViewTrait {
diff --git a/dash-frontend/src/views/skymap_list.rs b/dash-frontend/src/views/skymap_list.rs
index 66a58635..5bedf5ea 100644
--- a/dash-frontend/src/views/skymap_list.rs
+++ b/dash-frontend/src/views/skymap_list.rs
@@ -9,7 +9,7 @@ use wgui::{
renderer_vk::text::custom_glyph::CustomGlyphData,
task::Tasks,
};
-use wlx_common::{async_executor::AsyncExecutor, config_io};
+use wlx_common::{async_executor::AsyncExecutor, config::GeneralConfig, config_io, dash_interface::ConfigChangeKind};
use crate::{
frontend::{FrontendTask, FrontendTasks},
@@ -75,7 +75,7 @@ impl ViewTrait for View {
self.show_skymap_resolution_selector(entry);
}
Task::SetSkymap(entry, resolution) => {
- self.set_skymap(entry, resolution)?;
+ self.set_skymap(entry, resolution, par.general_config, par.config_change_kind)?;
}
}
}
@@ -132,16 +132,23 @@ impl View {
Ok(())
}
- fn set_skymap(&mut self, entry: SkymapCatalogEntry, resolution: SkymapResolution) -> anyhow::Result<()> {
+ fn set_skymap(
+ &mut self,
+ entry: SkymapCatalogEntry,
+ resolution: SkymapResolution,
+ config: &mut GeneralConfig,
+ change_kind: &mut Option,
+ ) -> anyhow::Result<()> {
let skymap_file_path = entry
.get_destination_path(resolution)
.context("Skymap not found" /* you shouldn't really see this, like ever. */)?;
- log::error!(
- "not implemented (skymap path to be loaded: {} with resolution {:?})",
- skymap_file_path.to_string_lossy(),
- resolution
- );
+ config.skybox_texture = config_io::get_skymaps_root()
+ .join(skymap_file_path)
+ .to_str()
+ .context("Skymap filename not valid UTF-8")?
+ .into();
+ *change_kind = Some(ConfigChangeKind::EnvironmentBlend);
Ok(())
}
diff --git a/wayvr/src/backend/openxr/helpers.rs b/wayvr/src/backend/openxr/helpers.rs
index 5f85a094..0f9b352f 100644
--- a/wayvr/src/backend/openxr/helpers.rs
+++ b/wayvr/src/backend/openxr/helpers.rs
@@ -214,6 +214,7 @@ pub(super) fn posef_to_transform(pose: &xr::Posef) -> Affine3A {
pub(super) fn try_apply_chroma_key(app: &AppState) -> bool {
let Some(monado) = app.monado_state.as_ref() else {
+ log::warn!("Could not set Chroma Key: no monado_state");
return false;
};
@@ -230,6 +231,5 @@ pub(super) fn try_apply_chroma_key(app: &AppState) -> bool {
return false;
}
- // if all values were non-0, assume we're in chroma key mode
- params.hsv_max[0] * params.hsv_max[1] * params.hsv_max[2] * params.curve > 0.001
+ params.curve > 0.001
}
diff --git a/wayvr/src/backend/openxr/mod.rs b/wayvr/src/backend/openxr/mod.rs
index 8e3787ed..f6ec7a44 100644
--- a/wayvr/src/backend/openxr/mod.rs
+++ b/wayvr/src/backend/openxr/mod.rs
@@ -569,6 +569,9 @@ fn reconfigure_environment_blend(
log::debug!("Allocating skybox.");
*skybox = create_skybox(xr_state, app);
}
+ } else {
+ log::debug!("Allocating skybox.");
+ *skybox = create_skybox(xr_state, app);
}
} else {
log::debug!("Destroying skybox.");