Compare commits

...
11 Commits
Author SHA1 Message Date
galister bcc9f5d277 Release 25.4.2 2025-04-12 18:04:00 +09:00
galister 5723d668e3 add issue template 2025-04-11 21:33:51 +09:00
Orion 1ae50a35ec add basic input blocking through libmonado (#190) 2025-04-11 11:14:09 +00:00
AdiMCS 5b23de0599 Add default space_reset binding for all controllers (#191)
* Converted tabs to spaces for consistency

* Added default space_reset binding as space_drag's double click variant for all controllers

* Fixed duplicate space_resets
2025-04-10 22:49:58 +00:00
galister cdbe3c4ad3 openvr lines are dirty by default 2025-04-11 05:12:02 +09:00
galister 412f199f91 openvr: native is srgb, set image_view for lines 2025-04-11 04:41:04 +09:00
Aleksander 4e30bb8cbe WayVR: doc: Rename executable name in the wayvr.yaml (#192)
[skip ci]
2025-04-10 19:30:44 +00:00
galister 45e53c15a3 steamvr staging texture to use native_format 2025-04-11 04:14:27 +09:00
galister 21a4797d2a update wlx-capture 2025-04-11 02:23:01 +09:00
galister a8ecc973a4 use srgb for openxr, linear for openvr 2025-04-11 02:13:02 +09:00
galister f12d151abf workaround attempt for cosmic desktop 2025-04-11 02:05:11 +09:00
17 changed files with 197 additions and 42 deletions

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
---
name: Bug Report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
## Description
<!--
If this is a regression, please mention which version was working previously.
-->
## System Info
**Linux Distribution**:
**Desktop Environment**:
<!-- Paste output of `uname -r` -->
**Kernel version**:
**VR Runtime**:
- [ ] Monado/WiVRn
- [ ] SteamVR/ALVR
<!-- Run `vulkaninfo --summary` and paste the devices section from the bottom. -->
**GPU models and driver versions**:
## Overlay Logs
<!-- Start the overlay once more with the following environment variables:
RUST_BACKTRACE=full
RUST_LOG=debug
If your issue is graphical or crash or freeze, also add:
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
Be sure to go and reproduce the issue once more, after these have been set.
Upload the log file from: /tmp/wlx.log
-->
Generated
+3 -5
View File
@@ -5270,26 +5270,24 @@ dependencies = [
[[package]]
name = "wlx-capture"
version = "0.5.0"
source = "git+https://github.com/galister/wlx-capture?tag=v0.5.0#fc77da75dcf8c9d59cdeea384da21bdab685d18b"
version = "0.5.2"
source = "git+https://github.com/galister/wlx-capture?tag=v0.5.2#c68c66d487ef0f57bab23b5c780472a31a01ecab"
dependencies = [
"ashpd",
"drm-fourcc",
"idmap",
"libc",
"log",
"once_cell",
"pipewire",
"rxscreen",
"smithay-client-toolkit",
"wayland-client",
"wayland-protocols",
"xcb",
]
[[package]]
name = "wlx-overlay-s"
version = "25.4.1"
version = "25.4.2"
dependencies = [
"anyhow",
"ash",
+2 -2
View File
@@ -4,7 +4,7 @@ debug = true
[package]
name = "wlx-overlay-s"
version = "25.4.1"
version = "25.4.2"
edition = "2021"
license = "GPL-3.0-only"
authors = ["galister"]
@@ -58,7 +58,7 @@ sysinfo = { version = "0.34.2" }
thiserror = "2.0.3"
vulkano = { version = "0.35.1" }
vulkano-shaders = { version = "0.35.0" }
wlx-capture = { git = "https://github.com/galister/wlx-capture", tag = "v0.5.0", default-features = false }
wlx-capture = { git = "https://github.com/galister/wlx-capture", tag = "v0.5.2", default-features = false }
libmonado = { git = "https://github.com/technobaboo/libmonado-rs", rev = "256895b18c8f9368174fad8a6232ff07764eeacb", optional = true }
winit = { version = "0.30.0", optional = true }
xdg = "2.5.2"
+2
View File
@@ -81,6 +81,8 @@ impl LinePool {
data: OpenVrOverlayData {
width: 0.002,
override_width: true,
image_view: Some(self.view.clone()),
image_dirty: true,
..Default::default()
},
..Default::default()
+5 -3
View File
@@ -65,9 +65,11 @@ impl OverlayData<OpenVrOverlayData> {
let Some(meta) = self.backend.frame_meta() else {
return Ok(false);
};
let image = app
.graphics
.render_texture(meta.extent[0], meta.extent[1], meta.format)?;
let image = app.graphics.render_texture(
meta.extent[0],
meta.extent[1],
app.graphics.native_format,
)?;
self.data.image_view = Some(ImageView::new_default(image)?);
Ok(true)
}
+73
View File
@@ -0,0 +1,73 @@
use libmonado::{ClientState, Monado};
use log::{info, warn};
use crate::{backend::overlay::OverlayID, state::AppState};
pub(super) struct InputBlocker {
hovered_last_frame: bool,
}
impl InputBlocker {
pub const fn new() -> Self {
Self {
hovered_last_frame: false,
}
}
pub fn update(&mut self, state: &AppState, watch_id: OverlayID, monado: &mut Monado) {
if !state.session.config.block_game_input {
return;
}
let any_hovered = state.input_state.pointers.iter().any(|p| {
p.interaction.hovered_id.is_some_and(|id| {
id != watch_id || !state.session.config.block_game_input_ignore_watch
})
});
match (any_hovered, self.hovered_last_frame) {
(true, false) => {
info!("Blocking input");
set_clients_io_active(monado, false);
}
(false, true) => {
info!("Unblocking input");
set_clients_io_active(monado, true);
}
_ => {}
}
self.hovered_last_frame = any_hovered;
}
}
fn set_clients_io_active(monado: &mut Monado, active: bool) {
match monado.clients() {
Ok(clients) => {
for mut client in clients {
let name = match client.name() {
Ok(n) => n,
Err(e) => {
warn!("Failed to get client name: {e}");
continue;
}
};
let state = match client.state() {
Ok(s) => s,
Err(e) => {
warn!("Failed to get client state: {e}");
continue;
}
};
if name != "wlx-overlay-s" && state.contains(ClientState::ClientSessionVisible) {
if let Err(e) = client.set_io_active(active) {
warn!("Failed to set io active for client: {e}");
}
}
}
}
Err(e) => warn!("Failed to get clients from Monado: {e}"),
}
}
+2 -2
View File
@@ -13,7 +13,7 @@ use vulkano::command_buffer::CommandBufferUsage;
use crate::{
backend::openxr::helpers,
graphics::{CommandBuffers, WlxGraphics, WlxPipeline, SWAPCHAIN_FORMAT},
graphics::{CommandBuffers, WlxGraphics, WlxPipeline},
};
use super::{
@@ -49,7 +49,7 @@ impl LinePool {
let pipeline = graphics.create_pipeline(
shaders.get("vert_common").unwrap().clone(), // want panic
shaders.get("frag_color").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
graphics.native_format,
None,
)?;
+11
View File
@@ -35,6 +35,7 @@ use crate::{
#[cfg(feature = "wayvr")]
use crate::{gui::modular::button::WayVRAction, overlays::wayvr::wayvr_action};
mod blocker;
mod helpers;
mod input;
mod lines;
@@ -108,6 +109,8 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
.ok()
});
let mut blocker = monado.is_some().then(blocker::InputBlocker::new);
let (session, mut frame_wait, mut frame_stream) = unsafe {
let raw_session = helpers::create_overlay_session(
&xr_instance,
@@ -268,6 +271,14 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
input_source.update(&xr_state, &mut app)?;
app.input_state.post_update(&app.session);
if let Some(ref mut blocker) = blocker {
blocker.update(
&app,
watch_id,
monado.as_mut().unwrap(), // safe
);
}
if app
.input_state
.pointers
+21 -5
View File
@@ -92,6 +92,10 @@
space_drag: {
left: "/user/hand/left/input/menu/click",
},
space_reset: {
double_click: true,
left: "/user/hand/left/input/menu/click",
},
click_modifier_right: {
left: "/user/hand/left/input/y/touch",
right: "/user/hand/right/input/b/touch"
@@ -138,10 +142,10 @@
left: "/user/hand/left/input/thumbstick/x",
right: "/user/hand/right/input/thumbstick/x"
},
toggle_dashboard: {
double_click: false,
right: "/user/hand/right/input/system/click",
},
toggle_dashboard: {
double_click: false,
right: "/user/hand/right/input/system/click",
},
show_hide: {
double_click: true,
left: "/user/hand/left/input/b/click",
@@ -151,8 +155,8 @@
// right trackpad is alt_click
},
space_reset: {
double_click: true,
left: "/user/hand/left/input/trackpad/force",
double_click: true,
},
click_modifier_right: {
left: "/user/hand/left/input/b/touch",
@@ -198,6 +202,10 @@
space_drag: {
right: "/user/hand/right/input/menu/click",
},
space_reset: {
double_click: true,
right: "/user/hand/right/input/menu/click",
},
haptic: {
left: "/user/hand/left/output/haptic",
right: "/user/hand/right/output/haptic"
@@ -237,6 +245,10 @@
space_drag: {
right: "/user/hand/right/input/menu/click",
},
space_reset: {
double_click: true,
right: "/user/hand/right/input/menu/click",
},
},
// HP Reverb G2 controller
@@ -272,6 +284,10 @@
space_drag: {
right: "/user/hand/right/input/menu/click",
},
space_reset: {
double_click: true,
right: "/user/hand/right/input/menu/click",
},
},
]
+3 -3
View File
@@ -14,7 +14,7 @@ use vulkano::{
use crate::{
backend::openxr::{helpers::translation_rotation_to_posef, swapchain::SwapchainOpts},
config_io,
graphics::{dds::WlxCommandBufferDds, CommandBuffers, SWAPCHAIN_FORMAT},
graphics::{dds::WlxCommandBufferDds, CommandBuffers},
state::AppState,
};
@@ -102,7 +102,7 @@ impl Skybox {
let pipeline = app.graphics.create_pipeline(
shaders.get("vert_common").unwrap().clone(), // want panic
shaders.get("frag_srgb").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
app.graphics.native_format,
None,
)?;
@@ -149,7 +149,7 @@ impl Skybox {
let pipeline = app.graphics.create_pipeline(
shaders.get("vert_common").unwrap().clone(), // want panic
shaders.get("frag_grid").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
app.graphics.native_format,
Some(AttachmentBlend::alpha()),
)?;
+3 -3
View File
@@ -9,7 +9,7 @@ use vulkano::{
Handle,
};
use crate::graphics::{WlxGraphics, SWAPCHAIN_FORMAT};
use crate::graphics::WlxGraphics;
use super::XrState;
@@ -43,7 +43,7 @@ pub(super) fn create_swapchain(
let swapchain = xr.session.create_swapchain(&xr::SwapchainCreateInfo {
create_flags,
usage_flags: xr::SwapchainUsageFlags::COLOR_ATTACHMENT | xr::SwapchainUsageFlags::SAMPLED,
format: SWAPCHAIN_FORMAT as _,
format: graphics.native_format as _,
sample_count: 1,
width: extent[0],
height: extent[1],
@@ -63,7 +63,7 @@ pub(super) fn create_swapchain(
graphics.device.clone(),
vk_image,
ImageCreateInfo {
format: SWAPCHAIN_FORMAT as _,
format: graphics.native_format as _,
extent,
usage: ImageUsage::COLOR_ATTACHMENT,
..Default::default()
+6
View File
@@ -273,6 +273,12 @@ pub struct GeneralConfig {
#[serde(default = "def_false")]
pub focus_follows_mouse_mode: bool,
#[serde(default = "def_false")]
pub block_game_input: bool,
#[serde(default = "def_true")]
pub block_game_input_ignore_watch: bool,
#[serde(default = "def_font")]
pub primary_font: Arc<str>,
+2 -4
View File
@@ -99,8 +99,6 @@ pub struct Vert2Uv {
pub in_uv: [f32; 2],
}
pub const SWAPCHAIN_FORMAT: Format = Format::R8G8B8A8_SRGB;
pub const INDICES: [u16; 6] = [2, 1, 0, 1, 2, 3];
pub const BLEND_ALPHA: AttachmentBlend = AttachmentBlend {
@@ -377,7 +375,7 @@ impl WlxGraphics {
graphics_queue,
transfer_queue,
capture_queue,
native_format: Format::R8G8B8A8_UNORM,
native_format: Format::R8G8B8A8_SRGB,
texture_filtering,
memory_allocator,
command_buffer_allocator,
@@ -529,7 +527,7 @@ impl WlxGraphics {
transfer_queue,
capture_queue,
memory_allocator,
native_format: Format::R8G8B8A8_UNORM,
native_format: Format::R8G8B8A8_SRGB,
texture_filtering,
command_buffer_allocator,
descriptor_set_allocator,
+4 -4
View File
@@ -11,7 +11,7 @@ use crate::{
input::{Haptics, InteractionHandler, PointerHit},
overlay::{FrameMeta, OverlayBackend, OverlayRenderer, ShouldRender},
},
graphics::{CommandBuffers, WlxGraphics, WlxPipeline, BLEND_ALPHA, SWAPCHAIN_FORMAT},
graphics::{CommandBuffers, WlxGraphics, WlxPipeline, BLEND_ALPHA},
state::AppState,
};
@@ -105,21 +105,21 @@ impl<D, S> Canvas<D, S> {
let pipeline_hl_color = graphics.create_pipeline(
vert.clone(),
shaders.get("frag_color").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
graphics.native_format,
Some(BLEND_ALPHA),
)?;
let pipeline_hl_sprite = graphics.create_pipeline(
vert.clone(),
shaders.get("frag_sprite2_hl").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
graphics.native_format,
Some(BLEND_ALPHA),
)?;
let pipeline_final = graphics.create_pipeline(
vert,
shaders.get("frag_srgb").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
graphics.native_format,
Some(BLEND_ALPHA),
)?;
+8 -6
View File
@@ -53,9 +53,7 @@ use crate::{
overlay::{FrameMeta, OverlayRenderer, OverlayState, ShouldRender, SplitOverlayBackend},
},
config::{def_pw_tokens, GeneralConfig, PwTokenMap},
graphics::{
fourcc_to_vk, CommandBuffers, WlxGraphics, WlxPipeline, WlxUploadsBuffer, SWAPCHAIN_FORMAT,
},
graphics::{fourcc_to_vk, CommandBuffers, WlxGraphics, WlxPipeline, WlxUploadsBuffer},
hid::{MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT},
state::{AppSession, AppState, KeyboardFocus, ScreenMeta},
};
@@ -168,7 +166,7 @@ impl ScreenPipeline {
let pipeline = app.graphics.create_pipeline(
shaders.get("vert_common").unwrap().clone(), // want panic
shaders.get("frag_screen").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
app.graphics.native_format,
Some(AttachmentBlend::default()),
)?;
@@ -805,8 +803,12 @@ pub fn create_screens_wayland(wl: &mut WlxClientAlias, app: &mut AppState) -> Sc
let logical_size = vec2(output.logical_size.0 as f32, output.logical_size.1 as f32);
let transform = output.transform.into();
let interaction = create_screen_interaction(logical_pos, logical_size, transform);
let state =
create_screen_state(output.name.clone(), output.size, transform, &app.session);
let state = create_screen_state(
output.name.clone(),
output.logical_size,
transform,
&app.session,
);
let meta = ScreenMeta {
name: wl.outputs[id].name.clone(),
+3 -2
View File
@@ -23,7 +23,7 @@ use crate::{
},
},
config_wayvr,
graphics::{CommandBuffers, WlxGraphics, WlxPipeline, SWAPCHAIN_FORMAT},
graphics::{CommandBuffers, WlxGraphics, WlxPipeline},
gui::modular::button::{WayVRAction, WayVRDisplayClickAction},
state::{self, AppState, KeyboardFocus},
};
@@ -190,7 +190,7 @@ impl WayVRRenderer {
let pipeline = app.graphics.create_pipeline(
shaders.get("vert_common").unwrap().clone(), // want panic
shaders.get("frag_srgb").unwrap().clone(), // want panic
SWAPCHAIN_FORMAT,
app.graphics.native_format,
None,
)?;
@@ -620,6 +620,7 @@ impl WayVRRenderer {
},
num_planes: 1,
planes,
..Default::default()
};
drop(wayvr);
+7 -3
View File
@@ -32,11 +32,15 @@ keyboard_repeat_rate: 50
# WayVR-compatible dashboard.
# For now, there is only one kind of dashboard with WayVR IPC support (WayVR Dashboard).
#
# Build instructions: https://github.com/olekolek1000/wayvr-dashboard
# exec: Executable path, for example /home/USER/wayvr_dashboard/src-tauri/target/release/wayvr_dashboard
# GDK_BACKEND=wayland: Force-use Wayland for GTK apps
#
# exec: Executable path, for example "/home/USER/wayvr-dashboard/src-tauri/target/release/wayvr-dashboard"
# or just "wayvr-dashboard" if you have it installed from your package manager.
#
# GDK_BACKEND=wayland: Force-use Wayland for GTK apps.
dashboard:
exec: "wayvr_dashboard"
exec: "wayvr-dashboard"
args: ""
env: ["GDK_BACKEND=wayland"]