fix alpha, remove sound for dbus toasts

This commit is contained in:
galister
2024-02-22 00:32:10 +01:00
parent 4f99862108
commit ce573f52ea
6 changed files with 58 additions and 18 deletions

View File

@@ -158,7 +158,7 @@ impl NotificationManager {
let toast = Toast::new(msg.title, msg.content.unwrap_or_else(|| "".into()))
.with_timeout(msg.timeout.unwrap_or(5.))
.with_sound(msg.volume.unwrap_or(0.) > 0.1);
.with_sound(msg.volume.unwrap_or(-1.) >= 0.); // XSOverlay still plays at 0,
match sender.try_send(toast) {
Ok(_) => {}
@@ -187,9 +187,9 @@ fn parse_dbus(msg: &dbus::Message) -> anyhow::Result<Toast> {
};
Ok(Toast::new(title.into(), body.into())
.with_sound(true)
.with_timeout(5.0)
.with_opacity(1.0))
// leave the audio part to the desktop env
}
#[allow(non_snake_case)]

View File

@@ -173,8 +173,6 @@ pub fn openvr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
continue;
};
log::info!("Creating overlay: {}", state.name);
overlays.add(OverlayData {
state,
backend,
@@ -183,7 +181,6 @@ pub fn openvr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
}
TaskType::DropOverlay(sel) => {
if let Some(o) = overlays.mut_by_selector(&sel) {
log::info!("Dropping overlay: {}", o.state.name);
o.destroy(&mut overlay_mngr);
overlays.drop_by_selector(&sel);
}

View File

@@ -7,6 +7,7 @@ use openxr as xr;
use smallvec::SmallVec;
use vulkano::{
image::{sampler::Filter, sys::RawImage, view::ImageView, ImageCreateInfo, ImageUsage},
pipeline::graphics::color_blend::AttachmentBlend,
Handle,
};
@@ -38,6 +39,7 @@ pub(super) fn create_swapchain_render_data(
shaders.get("vert_common").unwrap().clone(), // want panic
shaders.get("frag_srgb").unwrap().clone(), // want panic
graphics.native_format,
Some(AttachmentBlend::alpha()),
)?;
let images = swapchain