diff --git a/dash-frontend/src/frontend.rs b/dash-frontend/src/frontend.rs index ba7347f..f1397c7 100644 --- a/dash-frontend/src/frontend.rs +++ b/dash-frontend/src/frontend.rs @@ -18,8 +18,8 @@ use wlx_common::timestep::Timestep; use crate::{ assets, settings, tab::{ - apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, processes::TabProcesses, settings::TabSettings, - Tab, TabParams, TabType, + Tab, TabParams, TabType, apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, processes::TabProcesses, + settings::TabSettings, }, task::Tasks, util::{ diff --git a/uidev/src/main.rs b/uidev/src/main.rs index 96ed93d..5c3593b 100644 --- a/uidev/src/main.rs +++ b/uidev/src/main.rs @@ -1,26 +1,26 @@ -use glam::{vec2, Vec2}; +use glam::{Vec2, vec2}; use std::sync::Arc; -use testbed::{testbed_any::TestbedAny, Testbed}; +use testbed::{Testbed, testbed_any::TestbedAny}; use timestep::Timestep; +use tracing_subscriber::EnvFilter; use tracing_subscriber::filter::LevelFilter; use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::util::SubscriberInitExt; -use tracing_subscriber::EnvFilter; use vulkan::init_window; use vulkano::{ + Validated, VulkanError, command_buffer::CommandBufferUsage, format::Format, - image::{view::ImageView, ImageUsage}, + image::{ImageUsage, view::ImageView}, swapchain::{ - acquire_next_image, CompositeAlpha, PresentMode, Surface, SurfaceInfo, Swapchain, - SwapchainCreateInfo, SwapchainPresentInfo, + CompositeAlpha, PresentMode, Surface, SurfaceInfo, Swapchain, SwapchainCreateInfo, + SwapchainPresentInfo, acquire_next_image, }, sync::GpuFuture, - Validated, VulkanError, }; use wgui::{ event::{MouseButtonIndex, MouseDownEvent, MouseMotionEvent, MouseUpEvent, MouseWheelEvent}, - gfx::{cmd::WGfxClearMode, WGfx}, + gfx::{WGfx, cmd::WGfxClearMode}, renderer_vk::{self}, }; use winit::{ @@ -32,7 +32,7 @@ use winit::{ use crate::{ rate_limiter::RateLimiter, testbed::{ - testbed_dashboard::TestbedDashboard, testbed_generic::TestbedGeneric, TestbedUpdateParams, + TestbedUpdateParams, testbed_dashboard::TestbedDashboard, testbed_generic::TestbedGeneric, }, }; @@ -419,7 +419,9 @@ fn swapchain_create_info( composite_alpha = Some(c); break; } - log::warn!("GPU driver doesn't support {c:?} compositeAlpha! Desktop window will be blended using a fallback method and may look different than in VR."); + log::warn!( + "GPU driver doesn't support {c:?} compositeAlpha! Desktop window will be blended using a fallback method and may look different than in VR." + ); } let composite_alpha = composite_alpha .expect("GPU driver issue: VkSurfaceCapabilitiesKHR has empty supportedCompositeAlpha."); @@ -436,7 +438,9 @@ fn swapchain_create_info( present_mode = Some(pm); break; } - log::warn!("GPU driver doesn't support {pm:?} presentMode! Desktop window may have a higher latency and/or glitch during grab/resize."); + log::warn!( + "GPU driver doesn't support {pm:?} presentMode! Desktop window may have a higher latency and/or glitch during grab/resize." + ); } let present_mode = present_mode.expect("GPU driver issue: VkPresentModeKHR FIFO is not supported even though it's required by Vulkan spec."); diff --git a/uidev/src/testbed/testbed_generic.rs b/uidev/src/testbed/testbed_generic.rs index 0356784..9d93d6a 100644 --- a/uidev/src/testbed/testbed_generic.rs +++ b/uidev/src/testbed/testbed_generic.rs @@ -8,9 +8,9 @@ use glam::Vec2; use wgui::{ assets::AssetPath, components::{ + Component, button::{ButtonClickCallback, ComponentButton}, checkbox::ComponentCheckbox, - Component, }, drawing::Color, event::StyleSetRequest, diff --git a/uidev/src/vulkan.rs b/uidev/src/vulkan.rs index 9eac8b6..17e22a7 100644 --- a/uidev/src/vulkan.rs +++ b/uidev/src/vulkan.rs @@ -1,8 +1,8 @@ use std::sync::{Arc, OnceLock}; use vulkano::{ device::{ - physical::{PhysicalDevice, PhysicalDeviceType}, Device, DeviceCreateInfo, DeviceExtensions, DeviceFeatures, Queue, QueueCreateInfo, QueueFlags, + physical::{PhysicalDevice, PhysicalDeviceType}, }, instance::{Instance, InstanceCreateInfo}, }; diff --git a/wgui/src/gfx/mod.rs b/wgui/src/gfx/mod.rs index 16300bb..dfc3538 100644 --- a/wgui/src/gfx/mod.rs +++ b/wgui/src/gfx/mod.rs @@ -7,26 +7,26 @@ use std::{marker::PhantomData, slice::Iter, sync::Arc}; use cmd::{GfxCommandBuffer, XferCommandBuffer}; use pipeline::WGfxPipeline; use vulkano::{ + DeviceSize, buffer::{Buffer, BufferContents, BufferCreateInfo, BufferUsage, IndexBuffer, Subbuffer}, command_buffer::{ - allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo}, AutoCommandBufferBuilder, CommandBufferUsage, + allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo}, }, descriptor_set::allocator::{StandardDescriptorSetAllocator, StandardDescriptorSetAllocatorCreateInfo}, device::{Device, Queue}, format::Format, - image::{sampler::Filter, Image, ImageCreateInfo, ImageType, ImageUsage}, + image::{Image, ImageCreateInfo, ImageType, ImageUsage, sampler::Filter}, instance::Instance, memory::{ - allocator::{AllocationCreateInfo, GenericMemoryAllocatorCreateInfo, MemoryTypeFilter, StandardMemoryAllocator}, MemoryPropertyFlags, + allocator::{AllocationCreateInfo, GenericMemoryAllocatorCreateInfo, MemoryTypeFilter, StandardMemoryAllocator}, }, pipeline::graphics::{ color_blend::{AttachmentBlend, BlendFactor, BlendOp}, vertex_input::Vertex, }, shader::ShaderModule, - DeviceSize, }; use crate::gfx::pipeline::WPipelineCreateInfo; diff --git a/wgui/src/gfx/pass.rs b/wgui/src/gfx/pass.rs index 612e4a8..2dc3c0c 100644 --- a/wgui/src/gfx/pass.rs +++ b/wgui/src/gfx/pass.rs @@ -13,12 +13,12 @@ use vulkano::{ view::ImageView, }, pipeline::{ - graphics::{self, vertex_input::Vertex, viewport::Viewport}, Pipeline, PipelineBindPoint, + graphics::{self, vertex_input::Vertex, viewport::Viewport}, }, }; -use super::{pipeline::WGfxPipeline, WGfx}; +use super::{WGfx, pipeline::WGfxPipeline}; pub struct WGfxPass { pub command_buffer: Arc, diff --git a/wgui/src/parser/component_checkbox.rs b/wgui/src/parser/component_checkbox.rs index 1dcdfb1..166ea96 100644 --- a/wgui/src/parser/component_checkbox.rs +++ b/wgui/src/parser/component_checkbox.rs @@ -48,4 +48,4 @@ pub fn parse_component_checkbox( process_component(ctx, Component(component), widget.id, attribs); Ok(widget.id) -} \ No newline at end of file +} diff --git a/wgui/src/parser/component_slider.rs b/wgui/src/parser/component_slider.rs index ed07c77..017383f 100644 --- a/wgui/src/parser/component_slider.rs +++ b/wgui/src/parser/component_slider.rs @@ -1,7 +1,7 @@ use crate::{ - components::{slider, Component}, + components::{Component, slider}, layout::WidgetID, - parser::{parse_check_f32, process_component, style::parse_style, AttribPair, ParserContext}, + parser::{AttribPair, ParserContext, parse_check_f32, process_component, style::parse_style}, widget::ConstructEssentials, }; diff --git a/wgui/src/renderer_vk/context.rs b/wgui/src/renderer_vk/context.rs index 7c1e3f3..3f3247b 100644 --- a/wgui/src/renderer_vk/context.rs +++ b/wgui/src/renderer_vk/context.rs @@ -2,21 +2,21 @@ use std::{cell::RefCell, rc::Rc, sync::Arc}; use cosmic_text::Buffer; use glam::{Mat4, Vec2, Vec3}; -use slotmap::{new_key_type, SlotMap}; +use slotmap::{SlotMap, new_key_type}; use vulkano::pipeline::graphics::viewport; use crate::{ drawing::{self}, font_config, - gfx::{cmd::GfxCommandBuffer, WGfx}, + gfx::{WGfx, cmd::GfxCommandBuffer}, }; use super::{ rect::{RectPipeline, RectRenderer}, text::{ + DEFAULT_METRICS, SWASH_CACHE, TextArea, TextBounds, text_atlas::{TextAtlas, TextPipeline}, text_renderer::TextRenderer, - TextArea, TextBounds, DEFAULT_METRICS, SWASH_CACHE, }, viewport::Viewport, }; diff --git a/wgui/src/renderer_vk/rect.rs b/wgui/src/renderer_vk/rect.rs index b1e52e7..54eb908 100644 --- a/wgui/src/renderer_vk/rect.rs +++ b/wgui/src/renderer_vk/rect.rs @@ -10,10 +10,10 @@ use vulkano::{ use crate::{ drawing::{Boundary, Rectangle}, gfx::{ + BLEND_ALPHA, WGfx, cmd::GfxCommandBuffer, pass::WGfxPass, pipeline::{WGfxPipeline, WPipelineCreateInfo}, - WGfx, BLEND_ALPHA, }, renderer_vk::model_buffer::ModelBuffer, }; diff --git a/wgui/src/renderer_vk/viewport.rs b/wgui/src/renderer_vk/viewport.rs index f85b2ff..05b8c35 100644 --- a/wgui/src/renderer_vk/viewport.rs +++ b/wgui/src/renderer_vk/viewport.rs @@ -29,10 +29,7 @@ impl Viewport { projection: WMat4::default(), }; - let params_buffer = gfx.new_buffer( - BufferUsage::UNIFORM_BUFFER | BufferUsage::TRANSFER_DST, - [params].iter(), - )?; + let params_buffer = gfx.new_buffer(BufferUsage::UNIFORM_BUFFER | BufferUsage::TRANSFER_DST, [params].iter())?; Ok(Self { params, @@ -46,10 +43,7 @@ impl Viewport { self .text_descriptor .get_or_insert_with(|| { - pipeline - .inner - .buffer(2, self.params_buffer.clone()) - .unwrap() // safe unwrap + pipeline.inner.buffer(2, self.params_buffer.clone()).unwrap() // safe unwrap }) .clone() } @@ -58,21 +52,13 @@ impl Viewport { self .rect_descriptor .get_or_insert_with(|| { - pipeline - .color_rect - .buffer(0, self.params_buffer.clone()) - .unwrap() // safe unwrap + pipeline.color_rect.buffer(0, self.params_buffer.clone()).unwrap() // safe unwrap }) .clone() } /// Updates the `Viewport` with the given `resolution` and `projection`. - pub fn update( - &mut self, - resolution: [u32; 2], - projection: &glam::Mat4, - pixel_scale: f32, - ) -> anyhow::Result<()> { + pub fn update(&mut self, resolution: [u32; 2], projection: &glam::Mat4, pixel_scale: f32) -> anyhow::Result<()> { if self.params.screen_resolution == resolution && self.params.projection.0 == *projection.as_ref() && self.params.pixel_scale == pixel_scale diff --git a/wlx-capture/src/wayland.rs b/wlx-capture/src/wayland.rs index 4b8df5b..ad6ca41 100644 --- a/wlx-capture/src/wayland.rs +++ b/wlx-capture/src/wayland.rs @@ -19,15 +19,15 @@ use smithay_client_toolkit::reexports::{ pub use wayland_client; use wayland_client::{ + Connection, Dispatch, EventQueue, Proxy, QueueHandle, backend::WaylandError, - globals::{registry_queue_init, GlobalList, GlobalListContents}, + globals::{GlobalList, GlobalListContents, registry_queue_init}, protocol::{ wl_output::{self, Transform, WlOutput}, wl_registry::{self, WlRegistry}, wl_seat::WlSeat, wl_shm::WlShm, }, - Connection, Dispatch, EventQueue, Proxy, QueueHandle, }; use crate::frame; diff --git a/wlx-capture/src/wlr_screencopy.rs b/wlx-capture/src/wlr_screencopy.rs index 0e6477b..a54ae80 100644 --- a/wlx-capture/src/wlr_screencopy.rs +++ b/wlx-capture/src/wlr_screencopy.rs @@ -10,19 +10,19 @@ use std::{ thread::JoinHandle, }; use wayland_client::{ - protocol::{wl_buffer::WlBuffer, wl_shm::Format, wl_shm_pool::WlShmPool}, Connection, Dispatch, Proxy, QueueHandle, WEnum, + protocol::{wl_buffer::WlBuffer, wl_shm::Format, wl_shm_pool::WlShmPool}, }; use smithay_client_toolkit::reexports::protocols_wlr::screencopy::v1::client::zwlr_screencopy_frame_v1::{ZwlrScreencopyFrameV1, self}; use crate::{ + WlxCapture, frame::{ - DrmFormat, FourCC, FrameFormat, FramePlane, MemFdFrame, WlxFrame, DRM_FORMAT_ARGB8888, - DRM_FORMAT_XRGB8888, + DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888, DrmFormat, FourCC, FrameFormat, FramePlane, + MemFdFrame, WlxFrame, }, wayland::WlxClient, - WlxCapture, }; struct BufData { diff --git a/wlx-common/src/timestep.rs b/wlx-common/src/timestep.rs index a1bf49e..be31516 100644 --- a/wlx-common/src/timestep.rs +++ b/wlx-common/src/timestep.rs @@ -2,69 +2,69 @@ use std::{sync::LazyLock, time::Instant}; static TIME_START: LazyLock = LazyLock::new(Instant::now); pub fn get_micros() -> u64 { - TIME_START.elapsed().as_micros() as u64 + TIME_START.elapsed().as_micros() as u64 } #[derive(Default)] pub struct Timestep { - current_time_us: u64, - accumulator: f32, - time_micros: u64, - ticks: u32, - speed: f32, - pub alpha: f32, - delta: f32, - loopnum: u8, + current_time_us: u64, + accumulator: f32, + time_micros: u64, + ticks: u32, + speed: f32, + pub alpha: f32, + delta: f32, + loopnum: u8, } impl Timestep { - pub fn new() -> Self { - let mut timestep = Self { - speed: 1.0, - ..Default::default() - }; + pub fn new() -> Self { + let mut timestep = Self { + speed: 1.0, + ..Default::default() + }; - timestep.reset(); - timestep - } + timestep.reset(); + timestep + } - fn calculate_alpha(&mut self) { - self.alpha = (self.accumulator / self.delta).clamp(0.0, 1.0); - } + fn calculate_alpha(&mut self) { + self.alpha = (self.accumulator / self.delta).clamp(0.0, 1.0); + } - pub fn set_tps(&mut self, tps: f32) { - self.delta = 1000.0 / tps; - } + pub fn set_tps(&mut self, tps: f32) { + self.delta = 1000.0 / tps; + } - pub fn reset(&mut self) { - self.current_time_us = get_micros(); - self.accumulator = 0.0; - } + pub fn reset(&mut self) { + self.current_time_us = get_micros(); + self.accumulator = 0.0; + } - pub fn on_tick(&mut self) -> bool { - let newtime = get_micros(); - let frametime = newtime - self.current_time_us; - self.time_micros += frametime; - self.current_time_us = newtime; - self.accumulator += frametime as f32 * self.speed / 1000.0; - self.calculate_alpha(); + pub fn on_tick(&mut self) -> bool { + let newtime = get_micros(); + let frametime = newtime - self.current_time_us; + self.time_micros += frametime; + self.current_time_us = newtime; + self.accumulator += frametime as f32 * self.speed / 1000.0; + self.calculate_alpha(); - if self.accumulator >= self.delta { - self.accumulator -= self.delta; - self.loopnum += 1; - self.ticks += 1; + if self.accumulator >= self.delta { + self.accumulator -= self.delta; + self.loopnum += 1; + self.ticks += 1; - if self.loopnum > 5 { - // cannot keep up! - self.loopnum = 0; - self.accumulator = 0.0; - return false; - } + if self.loopnum > 5 { + // cannot keep up! + self.loopnum = 0; + self.accumulator = 0.0; + return false; + } - true - } else { - self.loopnum = 0; - false - } - } + true + } else { + self.loopnum = 0; + false + } + } } diff --git a/wlx-overlay-s/src/backend/input.rs b/wlx-overlay-s/src/backend/input.rs index 5c3a0e9..9b6b67c 100644 --- a/wlx-overlay-s/src/backend/input.rs +++ b/wlx-overlay-s/src/backend/input.rs @@ -5,7 +5,7 @@ use std::{collections::VecDeque, time::Instant}; use glam::{Affine3A, Vec2, Vec3A, Vec3Swizzles}; use idmap_derive::IntegerId; -use smallvec::{smallvec, SmallVec}; +use smallvec::{SmallVec, smallvec}; use wlx_common::common::LeftRight; use wlx_common::windowing::{OverlayWindowState, Positioning}; @@ -16,7 +16,7 @@ use crate::state::{AppSession, AppState}; use crate::subsystem::hid::WheelDelta; use crate::subsystem::input::KeyboardFocus; use crate::windowing::manager::OverlayWindowManager; -use crate::windowing::window::{self, realign, OverlayWindowData}; +use crate::windowing::window::{self, OverlayWindowData, realign}; use crate::windowing::{OverlayID, OverlaySelector}; use super::task::TaskType; diff --git a/wlx-overlay-s/src/backend/openvr/input.rs b/wlx-overlay-s/src/backend/openvr/input.rs index 39400b2..8343825 100644 --- a/wlx-overlay-s/src/backend/openvr/input.rs +++ b/wlx-overlay-s/src/backend/openvr/input.rs @@ -2,13 +2,13 @@ use std::{array, fs::File, io::Write, time::Duration}; use anyhow::bail; use ovr_overlay::{ + TrackedDeviceIndex, input::{ActionHandle, ActionSetHandle, ActiveActionSet, InputManager, InputValueHandle}, sys::{ ETrackedControllerRole, ETrackedDeviceClass, ETrackedDeviceProperty, ETrackingUniverseOrigin, }, system::SystemManager, - TrackedDeviceIndex, }; use crate::{ diff --git a/wlx-overlay-s/src/backend/openvr/lines.rs b/wlx-overlay-s/src/backend/openvr/lines.rs index c4b70ed..3e2ddc6 100644 --- a/wlx-overlay-s/src/backend/openvr/lines.rs +++ b/wlx-overlay-s/src/backend/openvr/lines.rs @@ -1,6 +1,6 @@ use std::f32::consts::PI; -use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; +use std::sync::atomic::{AtomicUsize, Ordering}; use ash::vk::SubmitInfo; use glam::{Affine3A, Vec3, Vec3A, Vec4}; @@ -8,6 +8,7 @@ use idmap::IdMap; use ovr_overlay::overlay::OverlayManager; use ovr_overlay::sys::ETrackingUniverseOrigin; use vulkano::{ + VulkanObject, command_buffer::{ CommandBufferBeginInfo, CommandBufferLevel, CommandBufferUsage, RecordingCommandBuffer, }, @@ -15,21 +16,20 @@ use vulkano::{ image::view::ImageView, image::{Image, ImageLayout}, sync::{ - fence::{Fence, FenceCreateInfo}, AccessFlags, DependencyInfo, ImageMemoryBarrier, PipelineStages, + fence::{Fence, FenceCreateInfo}, }, - VulkanObject, }; use wgui::gfx::WGfx; use crate::backend::input::{HoverResult, PointerHit}; use crate::state::AppState; use crate::subsystem::hid::WheelDelta; +use crate::windowing::Z_ORDER_LINES; use crate::windowing::backend::{ FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender, }; use crate::windowing::window::{OverlayWindowConfig, OverlayWindowData}; -use crate::windowing::Z_ORDER_LINES; use super::overlay::OpenVrOverlayData; diff --git a/wlx-overlay-s/src/backend/openvr/manifest.rs b/wlx-overlay-s/src/backend/openvr/manifest.rs index e3e5d1c..33bfc91 100644 --- a/wlx-overlay-s/src/backend/openvr/manifest.rs +++ b/wlx-overlay-s/src/backend/openvr/manifest.rs @@ -1,6 +1,6 @@ use std::{fs::File, io::Read}; -use anyhow::{bail, Context}; +use anyhow::{Context, bail}; use json::{array, object}; use ovr_overlay::applications::ApplicationsManager; diff --git a/wlx-overlay-s/src/backend/openvr/mod.rs b/wlx-overlay-s/src/backend/openvr/mod.rs index 434b99e..7308a5c 100644 --- a/wlx-overlay-s/src/backend/openvr/mod.rs +++ b/wlx-overlay-s/src/backend/openvr/mod.rs @@ -5,32 +5,33 @@ use std::{ time::{Duration, Instant}, }; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use ovr_overlay::{ - sys::{ETrackedDeviceProperty, EVRApplicationType, EVREventType}, TrackedDeviceIndex, + sys::{ETrackedDeviceProperty, EVRApplicationType, EVREventType}, }; -use vulkano::{device::physical::PhysicalDevice, Handle, VulkanObject}; +use vulkano::{Handle, VulkanObject, device::physical::PhysicalDevice}; use wlx_common::overlays::ToastTopic; use crate::{ + RUNNING, backend::{ + BackendError, input::interact, openvr::{ helpers::adjust_gain, - input::{set_action_manifest, OpenVrInputSource}, + input::{OpenVrInputSource, set_action_manifest}, lines::LinePool, manifest::{install_manifest, uninstall_manifest}, overlay::OpenVrOverlayData, }, task::{OpenVrTask, OverlayTask, TaskType}, - BackendError, }, config::save_state, - graphics::{init_openvr_graphics, GpuFutures}, + graphics::{GpuFutures, init_openvr_graphics}, overlays::{ toast::Toast, - watch::{watch_fade, WATCH_NAME}, + watch::{WATCH_NAME, watch_fade}, }, state::AppState, subsystem::notifications::NotificationManager, @@ -38,7 +39,6 @@ use crate::{ backend::{RenderResources, ShouldRender}, manager::OverlayWindowManager, }, - RUNNING, }; #[cfg(feature = "wayvr")] diff --git a/wlx-overlay-s/src/backend/openvr/overlay.rs b/wlx-overlay-s/src/backend/openvr/overlay.rs index 850e654..ce5356c 100644 --- a/wlx-overlay-s/src/backend/openvr/overlay.rs +++ b/wlx-overlay-s/src/backend/openvr/overlay.rs @@ -8,8 +8,8 @@ use ovr_overlay::{ sys::{ETrackingUniverseOrigin, VRVulkanTextureData_t}, }; use vulkano::{ - image::{view::ImageView, ImageUsage}, Handle, VulkanObject, + image::{ImageUsage, view::ImageView}, }; use wgui::gfx::WGfx; diff --git a/wlx-overlay-s/src/backend/openxr/input.rs b/wlx-overlay-s/src/backend/openxr/input.rs index db7342d..4e96ce3 100644 --- a/wlx-overlay-s/src/backend/openxr/input.rs +++ b/wlx-overlay-s/src/backend/openxr/input.rs @@ -4,7 +4,7 @@ use std::{ time::{Duration, Instant}, }; -use glam::{bool, Affine3A, Quat, Vec3}; +use glam::{Affine3A, Quat, Vec3, bool}; use libmonado as mnd; use openxr::{self as xr, Quaternionf, Vector2f, Vector3f}; use serde::{Deserialize, Serialize}; @@ -15,7 +15,7 @@ use crate::{ state::{AppSession, AppState}, }; -use super::{helpers::posef_to_transform, XrState}; +use super::{XrState, helpers::posef_to_transform}; static CLICK_TIMES: [Duration; 3] = [ Duration::ZERO, diff --git a/wlx-overlay-s/src/backend/openxr/lines.rs b/wlx-overlay-s/src/backend/openxr/lines.rs index 221b06b..19610ce 100644 --- a/wlx-overlay-s/src/backend/openxr/lines.rs +++ b/wlx-overlay-s/src/backend/openxr/lines.rs @@ -4,16 +4,16 @@ use openxr as xr; use std::{ f32::consts::PI, sync::{ - atomic::{AtomicUsize, Ordering}, Arc, + atomic::{AtomicUsize, Ordering}, }, }; use wgui::gfx::{ + WGfx, cmd::WGfxClearMode, pass::WGfxPass, pipeline::{WGfxPipeline, WPipelineCreateInfo}, - WGfx, }; use crate::{ @@ -27,8 +27,8 @@ use vulkano::{ }; use super::{ - swapchain::{create_swapchain, SwapchainOpts, WlxSwapchain}, CompositionLayer, XrState, + swapchain::{SwapchainOpts, WlxSwapchain, create_swapchain}, }; static LINE_AUTO_INCREMENT: AtomicUsize = AtomicUsize::new(1); diff --git a/wlx-overlay-s/src/backend/openxr/mod.rs b/wlx-overlay-s/src/backend/openxr/mod.rs index 1659eaa..bfbbc15 100644 --- a/wlx-overlay-s/src/backend/openxr/mod.rs +++ b/wlx-overlay-s/src/backend/openxr/mod.rs @@ -1,7 +1,7 @@ use std::{ collections::VecDeque, ops::Add, - sync::{atomic::Ordering, Arc}, + sync::{Arc, atomic::Ordering}, time::{Duration, Instant}, }; @@ -14,17 +14,18 @@ use vulkano::{Handle, VulkanObject}; use wlx_common::overlays::ToastTopic; use crate::{ + FRAME_COUNTER, RUNNING, backend::{ + BackendError, input::interact, openxr::{lines::LinePool, overlay::OpenXrOverlayData}, task::{OverlayTask, TaskType}, - BackendError, }, config::save_state, - graphics::{init_openxr_graphics, GpuFutures}, + graphics::{GpuFutures, init_openxr_graphics}, overlays::{ toast::Toast, - watch::{watch_fade, WATCH_NAME}, + watch::{WATCH_NAME, watch_fade}, }, state::AppState, subsystem::notifications::NotificationManager, @@ -32,7 +33,6 @@ use crate::{ backend::{RenderResources, ShouldRender}, manager::OverlayWindowManager, }, - FRAME_COUNTER, RUNNING, }; #[cfg(feature = "wayvr")] diff --git a/wlx-overlay-s/src/backend/openxr/overlay.rs b/wlx-overlay-s/src/backend/openxr/overlay.rs index 3c56191..8847b07 100644 --- a/wlx-overlay-s/src/backend/openxr/overlay.rs +++ b/wlx-overlay-s/src/backend/openxr/overlay.rs @@ -4,9 +4,9 @@ use std::{f32::consts::PI, sync::Arc}; use vulkano::image::view::ImageView; use xr::EyeVisibility; -use super::{helpers, swapchain::WlxSwapchain, CompositionLayer, XrState}; +use super::{CompositionLayer, XrState, helpers, swapchain::WlxSwapchain}; use crate::{ - backend::openxr::swapchain::{create_swapchain, SwapchainOpts}, + backend::openxr::swapchain::{SwapchainOpts, create_swapchain}, state::AppState, windowing::window::OverlayWindowData, }; diff --git a/wlx-overlay-s/src/backend/openxr/skybox.rs b/wlx-overlay-s/src/backend/openxr/skybox.rs index 05ca8a3..7601ed4 100644 --- a/wlx-overlay-s/src/backend/openxr/skybox.rs +++ b/wlx-overlay-s/src/backend/openxr/skybox.rs @@ -15,13 +15,13 @@ use wgui::gfx::{cmd::WGfxClearMode, pipeline::WPipelineCreateInfo}; use crate::{ backend::openxr::{helpers::translation_rotation_to_posef, swapchain::SwapchainOpts}, config_io, - graphics::{dds::WlxCommandBufferDds, ExtentExt, GpuFutures}, + graphics::{ExtentExt, GpuFutures, dds::WlxCommandBufferDds}, state::AppState, }; use super::{ - swapchain::{create_swapchain, WlxSwapchain}, CompositionLayer, XrState, + swapchain::{WlxSwapchain, create_swapchain}, }; pub(super) struct Skybox { diff --git a/wlx-overlay-s/src/backend/task.rs b/wlx-overlay-s/src/backend/task.rs index 3385e49..f10bbaa 100644 --- a/wlx-overlay-s/src/backend/task.rs +++ b/wlx-overlay-s/src/backend/task.rs @@ -9,7 +9,7 @@ use serde::Deserialize; use crate::{ state::AppState, - windowing::{window::OverlayWindowConfig, OverlaySelector}, + windowing::{OverlaySelector, window::OverlayWindowConfig}, }; #[cfg(feature = "wayvr")] diff --git a/wlx-overlay-s/src/backend/wayvr/client.rs b/wlx-overlay-s/src/backend/wayvr/client.rs index b993344..838e05b 100644 --- a/wlx-overlay-s/src/backend/wayvr/client.rs +++ b/wlx-overlay-s/src/backend/wayvr/client.rs @@ -10,8 +10,9 @@ use smithay::{ use crate::backend::wayvr::{ExternalProcessRequest, WayVRTask}; use super::{ + ProcessWayVREnv, comp::{self, ClientState}, - display, process, ProcessWayVREnv, + display, process, }; pub struct WayVRClient { diff --git a/wlx-overlay-s/src/backend/wayvr/mod.rs b/wlx-overlay-s/src/backend/wayvr/mod.rs index 34a509d..89fcb99 100644 --- a/wlx-overlay-s/src/backend/wayvr/mod.rs +++ b/wlx-overlay-s/src/backend/wayvr/mod.rs @@ -21,9 +21,9 @@ use smallvec::SmallVec; use smithay::{ backend::{ egl, - renderer::{gles::GlesRenderer, ImportDma}, + renderer::{ImportDma, gles::GlesRenderer}, }, - input::{keyboard::XkbConfig, SeatState}, + input::{SeatState, keyboard::XkbConfig}, output::{Mode, Output}, reexports::wayland_server::{self, backend::ClientId}, wayland::{ @@ -45,7 +45,7 @@ use wayvr_ipc::{packet_client, packet_server}; use crate::{ state::AppState, - subsystem::hid::{WheelDelta, MODS_TO_KEYS}, + subsystem::hid::{MODS_TO_KEYS, WheelDelta}, }; const STR_INVALID_HANDLE_DISP: &str = "Invalid display handle"; diff --git a/wlx-overlay-s/src/config_wayvr.rs b/wlx-overlay-s/src/config_wayvr.rs index 9ca0c5b..03946e8 100644 --- a/wlx-overlay-s/src/config_wayvr.rs +++ b/wlx-overlay-s/src/config_wayvr.rs @@ -19,7 +19,7 @@ use crate::{ }, config::load_config_with_conf_d, config_io, - overlays::wayvr::{executable_exists_in_path, WayVRData}, + overlays::wayvr::{WayVRData, executable_exists_in_path}, }; // Flat version of RelativeTo diff --git a/wlx-overlay-s/src/graphics/dds.rs b/wlx-overlay-s/src/graphics/dds.rs index e6a7f4a..f309ac8 100644 --- a/wlx-overlay-s/src/graphics/dds.rs +++ b/wlx-overlay-s/src/graphics/dds.rs @@ -1,12 +1,12 @@ use image_dds::{ImageFormat, Surface}; use std::{io::Read, sync::Arc}; use vulkano::{ + DeviceSize, buffer::{Buffer, BufferCreateInfo, BufferUsage, Subbuffer}, command_buffer::CopyBufferToImageInfo, format::Format, image::{Image, ImageCreateInfo, ImageType, ImageUsage}, memory::allocator::{AllocationCreateInfo, MemoryTypeFilter}, - DeviceSize, }; use wgui::gfx::cmd::XferCommandBuffer; @@ -22,7 +22,9 @@ impl WlxCommandBufferDds for XferCommandBuffer { R: Read, { let Ok(dds) = image_dds::ddsfile::Dds::read(r) else { - anyhow::bail!("Not a valid DDS file.\nSee: https://github.com/galister/wlx-overlay-s/wiki/Custom-Textures"); + anyhow::bail!( + "Not a valid DDS file.\nSee: https://github.com/galister/wlx-overlay-s/wiki/Custom-Textures" + ); }; let surface = Surface::from_dds(&dds)?; diff --git a/wlx-overlay-s/src/graphics/dmabuf.rs b/wlx-overlay-s/src/graphics/dmabuf.rs index 1239a24..c0f30a8 100644 --- a/wlx-overlay-s/src/graphics/dmabuf.rs +++ b/wlx-overlay-s/src/graphics/dmabuf.rs @@ -7,21 +7,21 @@ use std::{ use anyhow::Context; use smallvec::SmallVec; use vulkano::{ + VulkanError, VulkanObject, device::Device, format::Format, - image::{sys::RawImage, Image, ImageCreateInfo, ImageTiling, ImageUsage, SubresourceLayout}, + image::{Image, ImageCreateInfo, ImageTiling, ImageUsage, SubresourceLayout, sys::RawImage}, memory::{ - allocator::{MemoryAllocator, MemoryTypeFilter}, DedicatedAllocation, DeviceMemory, ExternalMemoryHandleType, ExternalMemoryHandleTypes, MemoryAllocateInfo, MemoryImportInfo, MemoryPropertyFlags, ResourceMemory, + allocator::{MemoryAllocator, MemoryTypeFilter}, }, sync::Sharing, - VulkanError, VulkanObject, }; use wgui::gfx::WGfx; use wlx_capture::frame::{ - DmabufFrame, DrmFormat, FourCC, DRM_FORMAT_ABGR2101010, DRM_FORMAT_ABGR8888, - DRM_FORMAT_ARGB8888, DRM_FORMAT_XBGR2101010, DRM_FORMAT_XBGR8888, DRM_FORMAT_XRGB8888, + DRM_FORMAT_ABGR8888, DRM_FORMAT_ABGR2101010, DRM_FORMAT_ARGB8888, DRM_FORMAT_XBGR8888, + DRM_FORMAT_XBGR2101010, DRM_FORMAT_XRGB8888, DmabufFrame, DrmFormat, FourCC, }; pub const DRM_FORMAT_MOD_INVALID: u64 = 0xff_ffff_ffff_ffff; diff --git a/wlx-overlay-s/src/graphics/mod.rs b/wlx-overlay-s/src/graphics/mod.rs index f9f86a7..aed4fe4 100644 --- a/wlx-overlay-s/src/graphics/mod.rs +++ b/wlx-overlay-s/src/graphics/mod.rs @@ -6,7 +6,7 @@ use std::{ sync::{Arc, OnceLock}, }; -use glam::{vec2, Vec2}; +use glam::{Vec2, vec2}; use vulkano::{ buffer::{BufferCreateInfo, BufferUsage}, command_buffer::{CommandBufferUsage, PrimaryAutoCommandBuffer, PrimaryCommandBufferAbstract}, @@ -26,11 +26,11 @@ use crate::shaders::{frag_color, frag_grid, frag_screen, frag_srgb, vert_quad}; use {ash::vk, std::os::raw::c_void}; use vulkano::{ - self, + self, VulkanObject, buffer::{Buffer, BufferContents, IndexBuffer, Subbuffer}, device::{ - physical::{PhysicalDevice, PhysicalDeviceType}, DeviceCreateInfo, DeviceExtensions, DeviceFeatures, Queue, QueueCreateInfo, QueueFlags, + physical::{PhysicalDevice, PhysicalDeviceType}, }, format::Format, instance::{Instance, InstanceCreateInfo, InstanceExtensions}, @@ -39,7 +39,6 @@ use vulkano::{ vertex_input::Vertex, }, shader::ShaderModule, - VulkanObject, }; use dmabuf::get_drm_formats; diff --git a/wlx-overlay-s/src/gui/panel/button.rs b/wlx-overlay-s/src/gui/panel/button.rs index e2d63e0..38e8816 100644 --- a/wlx-overlay-s/src/gui/panel/button.rs +++ b/wlx-overlay-s/src/gui/panel/button.rs @@ -2,7 +2,7 @@ use std::{ cell::RefCell, process::{Command, Stdio}, rc::Rc, - sync::{atomic::Ordering, Arc}, + sync::{Arc, atomic::Ordering}, time::{Duration, Instant}, }; @@ -18,6 +18,7 @@ use wgui::{ use wlx_common::overlays::ToastTopic; use crate::{ + RUNNING, backend::task::{OverlayTask, PlayspaceTask, TaskType}, gui::panel::helper::PipeReaderThread, overlays::{ @@ -26,7 +27,6 @@ use crate::{ }, state::AppState, windowing::OverlaySelector, - RUNNING, }; #[cfg(feature = "wayvr")] diff --git a/wlx-overlay-s/src/gui/panel/helper.rs b/wlx-overlay-s/src/gui/panel/helper.rs index 63889d6..9594103 100644 --- a/wlx-overlay-s/src/gui/panel/helper.rs +++ b/wlx-overlay-s/src/gui/panel/helper.rs @@ -4,8 +4,8 @@ use std::{ io::{BufRead, BufReader, Read}, process::Child, sync::{ - mpsc::{self, Receiver}, Arc, LazyLock, + mpsc::{self, Receiver}, }, thread::JoinHandle, }; diff --git a/wlx-overlay-s/src/gui/panel/label.rs b/wlx-overlay-s/src/gui/panel/label.rs index fbad9b3..66253b2 100644 --- a/wlx-overlay-s/src/gui/panel/label.rs +++ b/wlx-overlay-s/src/gui/panel/label.rs @@ -17,8 +17,8 @@ use wgui::{ event::{self, EventCallback}, i18n::Translation, layout::Layout, - parser::{parse_color_hex, CustomAttribsInfoOwned}, - widget::{label::WidgetLabel, EventResult}, + parser::{CustomAttribsInfoOwned, parse_color_hex}, + widget::{EventResult, label::WidgetLabel}, }; use crate::{gui::panel::helper::PipeReaderThread, state::AppState}; @@ -210,10 +210,9 @@ fn shell_on_tick( label.set_text(common, Translation::from_raw_text(&text)); } - if reader.is_finished() - && !mut_state.reader.take().unwrap().is_success() { - mut_state.next_try = Instant::now() + Duration::from_secs(15); - } + if reader.is_finished() && !mut_state.reader.take().unwrap().is_success() { + mut_state.next_try = Instant::now() + Duration::from_secs(15); + } return Ok(()); } else if mut_state.next_try > Instant::now() { return Ok(()); @@ -302,10 +301,9 @@ fn fifo_on_tick( label.set_text(common, Translation::from_raw_text(&text)); } - if reader.is_finished() - && !mut_state.reader.take().unwrap().is_success() { - mut_state.next_try = Instant::now() + Duration::from_secs(15); - } + if reader.is_finished() && !mut_state.reader.take().unwrap().is_success() { + mut_state.next_try = Instant::now() + Duration::from_secs(15); + } } const BAT_LOW: drawing::Color = drawing::Color::new(0.69, 0.38, 0.38, 1.); diff --git a/wlx-overlay-s/src/gui/panel/mod.rs b/wlx-overlay-s/src/gui/panel/mod.rs index 06ca2d7..6d9dfca 100644 --- a/wlx-overlay-s/src/gui/panel/mod.rs +++ b/wlx-overlay-s/src/gui/panel/mod.rs @@ -1,7 +1,7 @@ use std::{cell::RefCell, rc::Rc}; use button::setup_custom_button; -use glam::{vec2, Affine2, Vec2}; +use glam::{Affine2, Vec2, vec2}; use label::setup_custom_label; use wgui::{ assets::AssetPath, @@ -16,7 +16,7 @@ use wgui::{ layout::{Layout, LayoutParams, WidgetID}, parser::{CustomAttribsInfoOwned, Fetchable, ParserState}, renderer_vk::context::Context as WguiContext, - widget::{label::WidgetLabel, EventResult}, + widget::{EventResult, label::WidgetLabel}, }; use wlx_common::timestep::Timestep; @@ -25,7 +25,7 @@ use crate::{ state::AppState, subsystem::hid::WheelDelta, windowing::backend::{ - ui_transform, FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender, + FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender, ui_transform, }, }; diff --git a/wlx-overlay-s/src/main.rs b/wlx-overlay-s/src/main.rs index 47ee18c..7d7b09a 100644 --- a/wlx-overlay-s/src/main.rs +++ b/wlx-overlay-s/src/main.rs @@ -40,7 +40,7 @@ use clap::Parser; use subsystem::notifications::DbusNotificationSender; use sysinfo::Pid; use tracing::level_filters::LevelFilter; -use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; +use tracing_subscriber::{EnvFilter, layer::SubscriberExt, util::SubscriberInitExt}; pub static FRAME_COUNTER: AtomicUsize = AtomicUsize::new(0); pub static RUNNING: AtomicBool = AtomicBool::new(true); @@ -131,7 +131,7 @@ fn auto_run(args: Args) { #[cfg(feature = "openxr")] if !args_get_openvr(&args) { - use crate::backend::{openxr::openxr_run, BackendError}; + use crate::backend::{BackendError, openxr::openxr_run}; tried_xr = true; match openxr_run(args.show, args.headless) { Ok(()) => return, @@ -145,7 +145,7 @@ fn auto_run(args: Args) { #[cfg(feature = "openvr")] if !args_get_openxr(&args) { - use crate::backend::{openvr::openvr_run, BackendError}; + use crate::backend::{BackendError, openvr::openvr_run}; tried_vr = true; match openvr_run(args.show, args.headless) { Ok(()) => return, diff --git a/wlx-overlay-s/src/overlays/custom.rs b/wlx-overlay-s/src/overlays/custom.rs index c9c30d7..7484c0e 100644 --- a/wlx-overlay-s/src/overlays/custom.rs +++ b/wlx-overlay-s/src/overlays/custom.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use glam::{vec3, Affine3A, Quat, Vec3}; +use glam::{Affine3A, Quat, Vec3, vec3}; use wlx_common::windowing::OverlayWindowState; use crate::{ diff --git a/wlx-overlay-s/src/overlays/edit/mod.rs b/wlx-overlay-s/src/overlays/edit/mod.rs index bd29af8..343b5f7 100644 --- a/wlx-overlay-s/src/overlays/edit/mod.rs +++ b/wlx-overlay-s/src/overlays/edit/mod.rs @@ -20,16 +20,16 @@ use crate::{ input::HoverResult, task::{OverlayTask, TaskContainer, TaskType}, }, - gui::panel::{button::BUTTON_EVENTS, GuiPanel, NewGuiPanelParams, OnCustomAttribFunc}, + gui::panel::{GuiPanel, NewGuiPanelParams, OnCustomAttribFunc, button::BUTTON_EVENTS}, overlays::edit::{ lock::InteractLockHandler, pos::PositioningHandler, tab::ButtonPaneTabSwitcher, }, state::AppState, subsystem::hid::WheelDelta, windowing::{ + OverlayID, OverlaySelector, backend::{DummyBackend, OverlayBackend, OverlayEventData, RenderResources, ShouldRender}, window::OverlayWindowConfig, - OverlayID, OverlaySelector, }, }; diff --git a/wlx-overlay-s/src/overlays/keyboard/builder.rs b/wlx-overlay-s/src/overlays/keyboard/builder.rs index e24233c..66d4e9b 100644 --- a/wlx-overlay-s/src/overlays/keyboard/builder.rs +++ b/wlx-overlay-s/src/overlays/keyboard/builder.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, rc::Rc}; -use glam::{vec2, vec3, Affine3A, FloatExt, Mat4, Quat, Vec2, Vec3}; +use glam::{Affine3A, FloatExt, Mat4, Quat, Vec2, Vec3, vec2, vec3}; use wgui::{ animation::{Animation, AnimationEasing}, assets::AssetPath, @@ -11,10 +11,10 @@ use wgui::{ renderer_vk::util, taffy::{self, prelude::length}, widget::{ + EventResult, div::WidgetDiv, rectangle::{WidgetRectangle, WidgetRectangleParams}, util::WLength, - EventResult, }, }; use wlx_common::windowing::{OverlayWindowState, Positioning}; @@ -22,14 +22,14 @@ use wlx_common::windowing::{OverlayWindowState, Positioning}; use crate::{ gui::panel::GuiPanel, state::AppState, - subsystem::hid::{XkbKeymap, ALT, CTRL, META, SHIFT, SUPER}, + subsystem::hid::{ALT, CTRL, META, SHIFT, SUPER, XkbKeymap}, windowing::window::OverlayWindowConfig, }; use super::{ - handle_press, handle_release, + KEYBOARD_NAME, KeyButtonData, KeyState, KeyboardBackend, KeyboardState, handle_press, + handle_release, layout::{self, AltModifier, KeyCapType}, - KeyButtonData, KeyState, KeyboardBackend, KeyboardState, KEYBOARD_NAME, }; const BACKGROUND_PADDING: f32 = 16.0; diff --git a/wlx-overlay-s/src/overlays/keyboard/mod.rs b/wlx-overlay-s/src/overlays/keyboard/mod.rs index 81836eb..4006de2 100644 --- a/wlx-overlay-s/src/overlays/keyboard/mod.rs +++ b/wlx-overlay-s/src/overlays/keyboard/mod.rs @@ -12,7 +12,7 @@ use crate::{ backend::input::{HoverResult, PointerHit}, gui::panel::GuiPanel, state::AppState, - subsystem::hid::{KeyModifier, VirtualKey, WheelDelta, ALT, CTRL, META, SHIFT, SUPER}, + subsystem::hid::{ALT, CTRL, KeyModifier, META, SHIFT, SUPER, VirtualKey, WheelDelta}, windowing::backend::{ FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender, }, diff --git a/wlx-overlay-s/src/overlays/mirror.rs b/wlx-overlay-s/src/overlays/mirror.rs index 451b74b..5ae91dd 100644 --- a/wlx-overlay-s/src/overlays/mirror.rs +++ b/wlx-overlay-s/src/overlays/mirror.rs @@ -1,14 +1,14 @@ use std::{ sync::{ - atomic::{AtomicUsize, Ordering}, Arc, + atomic::{AtomicUsize, Ordering}, }, task::{Context, Poll}, }; use futures::{Future, FutureExt}; -use glam::{vec3, Affine2, Affine3A, Quat, Vec3}; -use wlx_capture::pipewire::{pipewire_select_screen, PipewireCapture, PipewireSelectScreenResult}; +use glam::{Affine2, Affine3A, Quat, Vec3, vec3}; +use wlx_capture::pipewire::{PipewireCapture, PipewireSelectScreenResult, pipewire_select_screen}; use wlx_common::windowing::OverlayWindowState; use crate::{ @@ -19,12 +19,12 @@ use crate::{ state::{AppSession, AppState}, subsystem::hid::WheelDelta, windowing::{ + OverlaySelector, backend::{ - ui_transform, FrameMeta, OverlayBackend, OverlayEventData, RenderResources, - ShouldRender, + FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender, + ui_transform, }, window::{OverlayCategory, OverlayWindowConfig}, - OverlaySelector, }, }; diff --git a/wlx-overlay-s/src/overlays/screen/backend.rs b/wlx-overlay-s/src/overlays/screen/backend.rs index 229f533..385e02b 100644 --- a/wlx-overlay-s/src/overlays/screen/backend.rs +++ b/wlx-overlay-s/src/overlays/screen/backend.rs @@ -1,22 +1,22 @@ use std::{ - sync::{atomic::AtomicU64, Arc, LazyLock}, + sync::{Arc, LazyLock, atomic::AtomicU64}, time::Instant, }; -use glam::{vec2, Affine2, Vec2}; -use wlx_capture::{frame::Transform, WlxCapture}; +use glam::{Affine2, Vec2, vec2}; +use wlx_capture::{WlxCapture, frame::Transform}; use crate::{ backend::input::{HoverResult, PointerHit, PointerMode}, graphics::ExtentExt, state::AppState, - subsystem::hid::{WheelDelta, MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT}, + subsystem::hid::{MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT, WheelDelta}, windowing::backend::{ FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender, }, }; -use super::capture::{receive_callback, ScreenPipeline, WlxCaptureIn, WlxCaptureOut}; +use super::capture::{ScreenPipeline, WlxCaptureIn, WlxCaptureOut, receive_callback}; const CURSOR_SIZE: f32 = 16. / 1440.; diff --git a/wlx-overlay-s/src/overlays/screen/mod.rs b/wlx-overlay-s/src/overlays/screen/mod.rs index bb6e0ce..ebfa6c4 100644 --- a/wlx-overlay-s/src/overlays/screen/mod.rs +++ b/wlx-overlay-s/src/overlays/screen/mod.rs @@ -1,6 +1,6 @@ use std::{f32::consts::PI, sync::Arc}; -use glam::{vec3, Affine3A, Quat, Vec3}; +use glam::{Affine3A, Quat, Vec3, vec3}; use wlx_capture::frame::Transform; use wlx_common::windowing::{OverlayWindowState, Positioning}; diff --git a/wlx-overlay-s/src/overlays/toast.rs b/wlx-overlay-s/src/overlays/toast.rs index 2debe54..847b715 100644 --- a/wlx-overlay-s/src/overlays/toast.rs +++ b/wlx-overlay-s/src/overlays/toast.rs @@ -5,7 +5,7 @@ use std::{ }; use anyhow::Context; -use glam::{vec3, Affine3A, Quat, Vec3}; +use glam::{Affine3A, Quat, Vec3, vec3}; use wgui::{i18n::Translation, widget::label::WidgetLabel}; use wlx_common::{ common::LeftRight, @@ -18,7 +18,7 @@ use crate::{ gui::panel::{GuiPanel, NewGuiPanelParams, OnCustomIdFunc}, overlays::watch::{WATCH_POS, WATCH_ROT}, state::AppState, - windowing::{window::OverlayWindowConfig, OverlaySelector, Z_ORDER_TOAST}, + windowing::{OverlaySelector, Z_ORDER_TOAST, window::OverlayWindowConfig}, }; const FONT_SIZE: isize = 16; diff --git a/wlx-overlay-s/src/overlays/watch.rs b/wlx-overlay-s/src/overlays/watch.rs index 6df3c9d..2575117 100644 --- a/wlx-overlay-s/src/overlays/watch.rs +++ b/wlx-overlay-s/src/overlays/watch.rs @@ -4,7 +4,7 @@ use std::{ time::{Duration, Instant}, }; -use glam::{vec3, Affine3A, Quat, Vec3, Vec3A}; +use glam::{Affine3A, Quat, Vec3, Vec3A, vec3}; use idmap::DirectIdMap; use wgui::{ components::button::ComponentButton, @@ -14,7 +14,7 @@ use wgui::{ parser::Fetchable, renderer_vk::text::custom_glyph::CustomGlyphData, taffy, - widget::{sprite::WidgetSprite, EventResult}, + widget::{EventResult, sprite::WidgetSprite}, }; use wlx_common::{ common::LeftRight, @@ -27,16 +27,16 @@ use crate::{ task::{OverlayTask, TaskType}, }, gui::{ - panel::{button::BUTTON_EVENTS, GuiPanel, NewGuiPanelParams, OnCustomAttribFunc}, + panel::{GuiPanel, NewGuiPanelParams, OnCustomAttribFunc, button::BUTTON_EVENTS}, timer::GuiTimer, }, overlays::edit::LongPressButtonState, state::AppState, windowing::{ + OverlaySelector, Z_ORDER_WATCH, backend::{OverlayEventData, OverlayMeta}, manager::MAX_OVERLAY_SETS, window::{OverlayWindowConfig, OverlayWindowData}, - OverlaySelector, Z_ORDER_WATCH, }, }; diff --git a/wlx-overlay-s/src/overlays/wayvr.rs b/wlx-overlay-s/src/overlays/wayvr.rs index d2f9045..468589c 100644 --- a/wlx-overlay-s/src/overlays/wayvr.rs +++ b/wlx-overlay-s/src/overlays/wayvr.rs @@ -1,18 +1,18 @@ use anyhow::Context; -use glam::{vec3, Affine2, Affine3A, Quat, Vec3}; +use glam::{Affine2, Affine3A, Quat, Vec3, vec3}; use smallvec::smallvec; use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc}; use vulkano::{ buffer::{BufferUsage, Subbuffer}, command_buffer::CommandBufferUsage, format::Format, - image::{view::ImageView, Image, ImageTiling, SubresourceLayout}, + image::{Image, ImageTiling, SubresourceLayout, view::ImageView}, }; use wayvr_ipc::packet_server::{self, PacketServer, WvrStateChanged}; use wgui::gfx::{ + WGfx, pass::WGfxPass, pipeline::{WGfxPipeline, WPipelineCreateInfo}, - WGfx, }; use wlx_capture::frame::{DmabufFrame, FourCC, FrameFormat, FramePlane}; use wlx_common::windowing::OverlayWindowState; @@ -22,23 +22,22 @@ use crate::{ input::{self, HoverResult}, task::{OverlayTask, TaskType}, wayvr::{ - self, display, + self, WayVR, WayVRAction, WayVRDisplayClickAction, display, server_ipc::{gen_args_vec, gen_env_vec}, - WayVR, WayVRAction, WayVRDisplayClickAction, }, }, config_wayvr, - graphics::{dmabuf::WGfxDmabuf, Vert2Uv}, + graphics::{Vert2Uv, dmabuf::WGfxDmabuf}, state::{self, AppState}, subsystem::{hid::WheelDelta, input::KeyboardFocus}, windowing::{ + OverlayID, OverlaySelector, Z_ORDER_DASHBOARD, backend::{ - ui_transform, FrameMeta, OverlayBackend, OverlayEventData, RenderResources, - ShouldRender, + FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender, + ui_transform, }, manager::OverlayWindowManager, window::{OverlayCategory, OverlayWindowConfig, OverlayWindowData}, - OverlayID, OverlaySelector, Z_ORDER_DASHBOARD, }, }; diff --git a/wlx-overlay-s/src/state.rs b/wlx-overlay-s/src/state.rs index d7dda2c..07e0329 100644 --- a/wlx-overlay-s/src/state.rs +++ b/wlx-overlay-s/src/state.rs @@ -1,6 +1,6 @@ use glam::Affine3A; use idmap::IdMap; -use smallvec::{smallvec, SmallVec}; +use smallvec::{SmallVec, smallvec}; use std::sync::Arc; use wgui::{ font_config::WguiFontConfig, gfx::WGfx, globals::WguiGlobals, diff --git a/wlx-overlay-s/src/subsystem/hid/mod.rs b/wlx-overlay-s/src/subsystem/hid/mod.rs index ee94160..8e4ff6b 100644 --- a/wlx-overlay-s/src/subsystem/hid/mod.rs +++ b/wlx-overlay-s/src/subsystem/hid/mod.rs @@ -1,5 +1,5 @@ use glam::Vec2; -use idmap::{idmap, IdMap}; +use idmap::{IdMap, idmap}; use idmap_derive::IntegerId; use input_linux::{ AbsoluteAxis, AbsoluteInfo, AbsoluteInfoSetup, EventKind, InputId, Key, RelativeAxis, diff --git a/wlx-overlay-s/src/subsystem/hid/wayland.rs b/wlx-overlay-s/src/subsystem/hid/wayland.rs index 0e5e326..17d2aa3 100644 --- a/wlx-overlay-s/src/subsystem/hid/wayland.rs +++ b/wlx-overlay-s/src/subsystem/hid/wayland.rs @@ -1,12 +1,12 @@ use anyhow::Context; use wlx_capture::wayland::wayland_client::{ - globals::{registry_queue_init, GlobalListContents}, + Connection, Dispatch, Proxy, QueueHandle, + globals::{GlobalListContents, registry_queue_init}, protocol::{ wl_keyboard::{self, WlKeyboard}, wl_registry::WlRegistry, wl_seat::{self, Capability, WlSeat}, }, - Connection, Dispatch, Proxy, QueueHandle, }; use xkbcommon::xkb; diff --git a/wlx-overlay-s/src/subsystem/hid/x11.rs b/wlx-overlay-s/src/subsystem/hid/x11.rs index d76a6fb..168ee07 100644 --- a/wlx-overlay-s/src/subsystem/hid/x11.rs +++ b/wlx-overlay-s/src/subsystem/hid/x11.rs @@ -1,8 +1,8 @@ use xkbcommon::xkb::{ self, x11::{ + MIN_MAJOR_XKB_VERSION, MIN_MINOR_XKB_VERSION, SetupXkbExtensionFlags, get_core_keyboard_device_id, keymap_new_from_device, setup_xkb_extension, - SetupXkbExtensionFlags, MIN_MAJOR_XKB_VERSION, MIN_MINOR_XKB_VERSION, }, }; diff --git a/wlx-overlay-s/src/windowing/backend.rs b/wlx-overlay-s/src/windowing/backend.rs index f662633..447f16e 100644 --- a/wlx-overlay-s/src/windowing/backend.rs +++ b/wlx-overlay-s/src/windowing/backend.rs @@ -7,8 +7,8 @@ use vulkano::{ image::view::ImageView, }; use wgui::gfx::{ - cmd::{GfxCommandBuffer, WGfxClearMode}, WGfx, + cmd::{GfxCommandBuffer, WGfxClearMode}, }; use crate::{ @@ -16,7 +16,7 @@ use crate::{ graphics::ExtentExt, state::AppState, subsystem::hid::WheelDelta, - windowing::{window::OverlayCategory, OverlayID}, + windowing::{OverlayID, window::OverlayCategory}, }; #[derive(Default, Clone, Copy)] diff --git a/wlx-overlay-s/src/windowing/manager.rs b/wlx-overlay-s/src/windowing/manager.rs index 70dfabb..d784128 100644 --- a/wlx-overlay-s/src/windowing/manager.rs +++ b/wlx-overlay-s/src/windowing/manager.rs @@ -12,6 +12,7 @@ use wlx_common::{ }; use crate::{ + FRAME_COUNTER, backend::task::OverlayTask, overlays::{ anchor::create_anchor, edit::EditWrapperManager, keyboard::builder::create_keyboard, @@ -19,13 +20,12 @@ use crate::{ }, state::AppState, windowing::{ + OverlayID, OverlaySelector, backend::{OverlayEventData, OverlayMeta}, set::OverlayWindowSet, snap_upright, window::{OverlayCategory, OverlayWindowData}, - OverlayID, OverlaySelector, }, - FRAME_COUNTER, }; pub const MAX_OVERLAY_SETS: usize = 7; @@ -331,7 +331,9 @@ impl OverlayWindowManager { log::debug!("set {i}: loaded state for {name}"); overlays.insert(id, o.clone()); } else { - log::debug!("set {i} has saved state for {name} which doesn't exist. will apply state once added."); + log::debug!( + "set {i} has saved state for {name} which doesn't exist. will apply state once added." + ); inactive_overlays.arc_set(name.clone(), o.clone()); } }