From fa0ab2f1fa4197fb46a3205d93f8ef6780387769 Mon Sep 17 00:00:00 2001 From: entailz Date: Sun, 3 May 2026 02:23:20 -0700 Subject: [PATCH] Format again... --- src/config/handler.rs | 4 +- src/gfx_apis/vulkan/blur.rs | 14 ++----- src/gfx_apis/vulkan/renderer.rs | 39 +++++++++---------- src/globals.rs | 2 +- .../hyprland_global_shortcuts_manager_v1.rs | 6 +-- src/ifs/wl_surface/xdg_surface/xdg_popup.rs | 5 +-- src/ifs/wl_surface/zwlr_layer_surface_v1.rs | 5 +-- src/state.rs | 3 +- toml-config/src/config/parsers/action.rs | 17 ++------ toml-config/src/config/parsers/blur.rs | 3 +- toml-config/src/config/parsers/config.rs | 2 +- .../src/config/parsers/modified_keysym.rs | 2 +- toml-config/src/lib.rs | 18 ++++----- 13 files changed, 41 insertions(+), 79 deletions(-) diff --git a/src/config/handler.rs b/src/config/handler.rs index b590a1c2..18dbef71 100644 --- a/src/config/handler.rs +++ b/src/config/handler.rs @@ -3544,9 +3544,7 @@ impl ConfigProxyHandler { fn handle_trigger_global_shortcut(&self, app_id: &str, id: &str) { let key = (app_id.to_string(), id.to_string()); let Some(shortcut) = self.state.hyprland_global_shortcuts.get(&key) else { - log::debug!( - "no client has registered hyprland global shortcut {app_id:?}:{id:?}" - ); + log::debug!("no client has registered hyprland global shortcut {app_id:?}:{id:?}"); return; }; shortcut.send_pressed_now(); diff --git a/src/gfx_apis/vulkan/blur.rs b/src/gfx_apis/vulkan/blur.rs index 7c4734a2..b63cc924 100644 --- a/src/gfx_apis/vulkan/blur.rs +++ b/src/gfx_apis/vulkan/blur.rs @@ -153,8 +153,7 @@ impl VulkanRenderer { let passes = passes.clamp(1, 6) as u32; let format = target.format.vk_format; - let mut levels: Vec> = - Vec::with_capacity(passes as usize + 1); + let mut levels: Vec> = Vec::with_capacity(passes as usize + 1); levels.push(self.acquire_blur_scratch(w, h, format)?); let mut cw = w; let mut ch = h; @@ -389,9 +388,7 @@ impl VulkanRenderer { let pipeline = self.get_or_create_blur_composite_pipeline(target.format.vk_format)?; - let target_render_view = target - .render_view - .unwrap_or(target.texture_view); + let target_render_view = target.render_view.unwrap_or(target.texture_view); let color_attachment = RenderingAttachmentInfo::default() .image_view(target_render_view) .image_layout(ImageLayout::COLOR_ATTACHMENT_OPTIMAL) @@ -425,12 +422,7 @@ impl VulkanRenderer { }; // Identity uv across blurred level 0 (full image is the blurred rect). - let blurred_tc: [[f32; 2]; 4] = [ - [1.0, 0.0], - [0.0, 0.0], - [1.0, 1.0], - [0.0, 1.0], - ]; + let blurred_tc: [[f32; 2]; 4] = [[1.0, 0.0], [0.0, 0.0], [1.0, 1.0], [0.0, 1.0]]; let push = BlurCompositePushConstants { pos: mask.target_points, blurred_tex_pos: blurred_tc, diff --git a/src/gfx_apis/vulkan/renderer.rs b/src/gfx_apis/vulkan/renderer.rs index 9758e7ff..c1de1a03 100644 --- a/src/gfx_apis/vulkan/renderer.rs +++ b/src/gfx_apis/vulkan/renderer.rs @@ -840,8 +840,8 @@ impl VulkanRenderer { .src_alpha_blend_factor(BlendFactor::ONE) .dst_alpha_blend_factor(BlendFactor::ONE_MINUS_SRC_ALPHA) .alpha_blend_op(BlendOp::ADD); - let color_blend_state = PipelineColorBlendStateCreateInfo::default() - .attachments(slice::from_ref(&blending)); + let color_blend_state = + PipelineColorBlendStateCreateInfo::default().attachments(slice::from_ref(&blending)); let dynamic_states = [DynamicState::VIEWPORT, DynamicState::SCISSOR]; let dynamic_state = PipelineDynamicStateCreateInfo::default().dynamic_states(&dynamic_states); @@ -1398,13 +1398,11 @@ impl VulkanRenderer { } else { None }; - memory.ops[RenderPass::FrameBuffer].push(VulkanOp::BlurBarrier( - VulkanBlurOp { - rect: b.rect, - passes: b.passes, - mask, - }, - )); + memory.ops[RenderPass::FrameBuffer].push(VulkanOp::BlurBarrier(VulkanBlurOp { + rect: b.rect, + passes: b.passes, + mask, + })); } } } @@ -2122,19 +2120,18 @@ impl VulkanRenderer { unsafe { dev.cmd_end_rendering(buf); } - let pix = blur - .rect - .to_rect(target.width as f32, target.height as f32); + let pix = blur.rect.to_rect(target.width as f32, target.height as f32); let rect_arr = [pix.x1(), pix.y1(), pix.x2(), pix.y2()]; - let mask_record = blur.mask.as_ref().map(|m| { - crate::gfx_apis::vulkan::blur::BlurMaskRecord { - mask_view: m.tex.texture_view, - mask_source_points: m.source.to_points(), - target_points: blur.rect.to_points(), - threshold: m.threshold, - _phantom: std::marker::PhantomData, - } - }); + let mask_record = + blur.mask + .as_ref() + .map(|m| crate::gfx_apis::vulkan::blur::BlurMaskRecord { + mask_view: m.tex.texture_view, + mask_source_points: m.source.to_points(), + target_points: blur.rect.to_points(), + threshold: m.threshold, + _phantom: std::marker::PhantomData, + }); self.record_blur( buf, target, diff --git a/src/globals.rs b/src/globals.rs index 9eff11e1..cd082b7f 100644 --- a/src/globals.rs +++ b/src/globals.rs @@ -30,6 +30,7 @@ use { wl_output::WlOutputGlobal, wl_registry::WlRegistry, wl_seat::{ + WlSeatGlobal, ext_transient_seat_manager_v1::ExtTransientSeatManagerV1Global, tablet::zwp_tablet_manager_v2::ZwpTabletManagerV2Global, text_input::{ @@ -41,7 +42,6 @@ use { zwp_pointer_gestures_v1::ZwpPointerGesturesV1Global, zwp_relative_pointer_manager_v1::ZwpRelativePointerManagerV1Global, zwp_virtual_keyboard_manager_v1::ZwpVirtualKeyboardManagerV1Global, - WlSeatGlobal, }, wl_shm::WlShmGlobal, wl_subcompositor::WlSubcompositorGlobal, diff --git a/src/ifs/hyprland_global_shortcuts_manager_v1.rs b/src/ifs/hyprland_global_shortcuts_manager_v1.rs index cb30a4f0..0e076262 100644 --- a/src/ifs/hyprland_global_shortcuts_manager_v1.rs +++ b/src/ifs/hyprland_global_shortcuts_manager_v1.rs @@ -55,11 +55,7 @@ impl HyprlandGlobalShortcutsManagerV1RequestHandler for HyprlandGlobalShortcutsM Ok(()) } - fn register_shortcut( - &self, - req: RegisterShortcut, - _slf: &Rc, - ) -> Result<(), Self::Error> { + fn register_shortcut(&self, req: RegisterShortcut, _slf: &Rc) -> Result<(), Self::Error> { let shortcut_id = req.id.to_string(); let app_id = req.app_id.to_string(); let key = (app_id.clone(), shortcut_id.clone()); diff --git a/src/ifs/wl_surface/xdg_surface/xdg_popup.rs b/src/ifs/wl_surface/xdg_surface/xdg_popup.rs index 96d3c332..7f7d053b 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_popup.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_popup.rs @@ -418,10 +418,7 @@ impl Node for XdgPopup { } fn node_render(&self, renderer: &mut Renderer, x: i32, y: i32, bounds: Option<&Rect>) { - let settings = self - .parent - .get() - .and_then(|p| p.layer_blur_settings()); + let settings = self.parent.get().and_then(|p| p.layer_blur_settings()); if let Some(s) = settings { if s.blur { let extents = self.xdg.surface.extents.get(); diff --git a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs index 49087454..f3b1e45f 100644 --- a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs +++ b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs @@ -825,10 +825,7 @@ impl XdgPopupParent for Popup { if !blur && ignore_alpha.is_none() { return None; } - Some(crate::ifs::wl_surface::xdg_surface::xdg_popup::LayerPopupBlur { - blur, - ignore_alpha, - }) + Some(crate::ifs::wl_surface::xdg_surface::xdg_popup::LayerPopupBlur { blur, ignore_alpha }) } } diff --git a/src/state.rs b/src/state.rs index 53acf724..9decfcd9 100644 --- a/src/state.rs +++ b/src/state.rs @@ -303,8 +303,7 @@ pub struct State { pub bo_drop_queue: Rc>>, pub virtual_outputs: VirtualOutputs, pub clean_logs_older_than: Cell>, - pub hyprland_global_shortcuts: - CopyHashMap<(String, String), Rc>, + pub hyprland_global_shortcuts: CopyHashMap<(String, String), Rc>, pub layer_rules: RefCell>, pub blur_config: Cell, } diff --git a/toml-config/src/config/parsers/action.rs b/toml-config/src/config/parsers/action.rs index a3b8f852..1e8a06ac 100644 --- a/toml-config/src/config/parsers/action.rs +++ b/toml-config/src/config/parsers/action.rs @@ -521,22 +521,13 @@ impl ActionParser<'_> { }) } - fn parse_global_shortcut( - &mut self, - span: Span, - ext: &mut Extractor<'_>, - ) -> ParseResult { - let (name_opt, app_id_opt, id_opt) = ext.extract(( - opt(str("name")), - opt(str("app_id")), - opt(str("id")), - ))?; + fn parse_global_shortcut(&mut self, span: Span, ext: &mut Extractor<'_>) -> ParseResult { + let (name_opt, app_id_opt, id_opt) = + ext.extract((opt(str("name")), opt(str("app_id")), opt(str("id"))))?; let (app_id, id) = match (app_id_opt, id_opt, name_opt) { (Some(a), Some(i), _) => (a.value.to_string(), i.value.to_string()), (None, None, Some(n)) => match n.value.split_once(':') { - Some((a, i)) if !a.is_empty() && !i.is_empty() => { - (a.to_string(), i.to_string()) - } + Some((a, i)) if !a.is_empty() && !i.is_empty() => (a.to_string(), i.to_string()), _ => { return Err( ActionParserError::GlobalShortcutBadName(n.value.to_string()) diff --git a/toml-config/src/config/parsers/blur.rs b/toml-config/src/config/parsers/blur.rs index 04aa1522..c5aa48ab 100644 --- a/toml-config/src/config/parsers/blur.rs +++ b/toml-config/src/config/parsers/blur.rs @@ -36,8 +36,7 @@ impl Parser for BlurConfigParser<'_> { table: &IndexMap, Spanned>, ) -> ParseResult { let mut ext = Extractor::new(self.0, span, table); - let (passes_val, size_val) = - ext.extract((opt(int("passes")), opt(fltorint("size"))))?; + let (passes_val, size_val) = ext.extract((opt(int("passes")), opt(fltorint("size"))))?; let passes = passes_val.despan().and_then(|v| u8::try_from(v).ok()); let size = size_val.despan().map(|v| v as f32); Ok(BlurConfig { passes, size }) diff --git a/toml-config/src/config/parsers/config.rs b/toml-config/src/config/parsers/config.rs index b27eb938..ab169895 100644 --- a/toml-config/src/config/parsers/config.rs +++ b/toml-config/src/config/parsers/config.rs @@ -8,6 +8,7 @@ use { parsers::{ action::ActionParser, actions::ActionsParser, + blur::BlurConfigParser, clean_logs_older_than::CleanLogsOlderThanParser, client_rule::ClientRulesParser, color_management::ColorManagementParser, @@ -23,7 +24,6 @@ use { input::InputsParser, input_mode::InputModesParser, keymap::KeymapParser, - blur::BlurConfigParser, layer_rule::LayerRulesParser, libei::LibeiParser, log_level::LogLevelParser, diff --git a/toml-config/src/config/parsers/modified_keysym.rs b/toml-config/src/config/parsers/modified_keysym.rs index 8ad375c7..43e633bd 100644 --- a/toml-config/src/config/parsers/modified_keysym.rs +++ b/toml-config/src/config/parsers/modified_keysym.rs @@ -49,7 +49,7 @@ impl Parser for ModifiedKeysymParser { } let Some(new) = Keysym::from_str(part) else { return Err( - ModifiedKeysymParserError::UnknownKeysym(part.to_string()).spanned(span), + ModifiedKeysymParserError::UnknownKeysym(part.to_string()).spanned(span) ); }; let new = KeySym(new.0); diff --git a/toml-config/src/lib.rs b/toml-config/src/lib.rs index 538aa815..85b92127 100644 --- a/toml-config/src/lib.rs +++ b/toml-config/src/lib.rs @@ -13,9 +13,8 @@ mod toml; use { crate::{ config::{ - Action, ClientRule, Config, ConfigConnector, ConfigDrmDevice, ConfigKeymap, - BlurConfig, ConnectorMatch, DrmDeviceMatch, Exec, Input, InputMatch, LayerKind, - LayerRule, Output, + Action, BlurConfig, ClientRule, Config, ConfigConnector, ConfigDrmDevice, ConfigKeymap, + ConnectorMatch, DrmDeviceMatch, Exec, Input, InputMatch, LayerKind, LayerRule, Output, OutputMatch, SimpleCommand, Status, Theme, WindowRule, parse_config, }, rules::{MatcherTemp, RuleMapper}, @@ -24,7 +23,8 @@ use { ahash::{AHashMap, AHashSet}, error_reporter::Report, jay_config::{ - Axis, + _private::{BlurConfigIpc, LayerKindIpc, LayerMatchIpc, LayerRuleIpc}, + _set_blur_config, _set_layer_rules, Axis, client::Client, config, config_dir, exec::{Command, set_env, unset_env}, @@ -38,8 +38,6 @@ use { is_reload, keyboard::Keymap, logging::{clean_logs_older_than, set_log_level}, - _set_blur_config, _set_layer_rules, - _private::{BlurConfigIpc, LayerKindIpc, LayerMatchIpc, LayerRuleIpc}, on_devices_enumerated, on_idle, on_unload, quit, reload, set_autotile, set_color_management_enabled, set_corner_radius, set_default_workspace_capture, set_explicit_sync_enabled, set_float_above_fullscreen, set_floating_titles, set_idle, @@ -511,11 +509,9 @@ impl Action { Action::Resize { dx1, dy1, dx2, dy2 } => { window_or_seat!(s, s.resize(dx1, dy1, dx2, dy2)) } - Action::TriggerGlobalShortcut { app_id, id } => { - b.new(move || { - jay_config::trigger_global_shortcut(&app_id, &id); - }) - } + Action::TriggerGlobalShortcut { app_id, id } => b.new(move || { + jay_config::trigger_global_shortcut(&app_id, &id); + }), } } }