From 78da614d67c09e197dffc1cebb1c5ce2357c7128 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:06:00 +0200 Subject: Add per-window resize-margin override (Hyprland's extend_border_grab_area) MISSING.md had listed this as needing to touch srdwm_core::window:: hit_test's signature at every call site, including the honest-stub Windows/macOS backends - overstated on closer inspection: that shared function already takes a plain resize_margin: i32 parameter, agnostic to where the value comes from. The only real change needed was reading Window.resize_margin.unwrap_or(wm-wide default) instead of always the WM-wide value, at the single call site inside WindowManager::hit_test in core - no backend touched at all. Window.resize_margin: Option, WindowRuleActions.resize_margin to match, applied in add_window/reapply_rules_if_pending the same way opacity already is. Settable via a rule action or srd.window.set_resize_margin(n) on the focused window. --- crates/core/src/manager/hittest.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/core/src/manager/hittest.rs') diff --git a/crates/core/src/manager/hittest.rs b/crates/core/src/manager/hittest.rs index 2d52b57..06ac659 100644 --- a/crates/core/src/manager/hittest.rs +++ b/crates/core/src/manager/hittest.rs @@ -24,7 +24,8 @@ impl WindowManager { if w.minimized || w.workspace != self.current_workspace { continue; } - if let Some(hit) = ResizeEdge::hit_test(w.geometry, x, y, w.decorated, w.border_width, self.resize_margin) { + let margin = w.resize_margin.unwrap_or(self.resize_margin); + if let Some(hit) = ResizeEdge::hit_test(w.geometry, x, y, w.decorated, w.border_width, margin) { return Some((w.id, hit)); } } -- cgit v1.2.3