Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
fix: make entire border a resize zone to prevent accidental window movement
src/server/cursor.rs | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/src/server/cursor.rs b/src/server/cursor.rs
index 90aed1f..52f3f79 100644
--- a/src/server/cursor.rs
+++ b/src/server/cursor.rs
@@ -1211,26 +1211,18 @@ pub unsafe fn get_border_zone(window: *mut crate::window::Window, lx: f64, ly: f
}
if rx >= -bw && rx < content_w + bw && ry >= -bw && ry < content_h + bw {
- let threshold = if bw <= 3.0 { bw / 2.0 } else { 3.0 };
-
let dist_left = rx + bw;
let dist_right = (content_w + bw) - rx;
let dist_top = ry + bw;
let dist_bottom = (content_h + bw) - ry;
- let min_dist = dist_left.min(dist_right).min(dist_top).min(dist_bottom);
-
- if min_dist >= 0.0 && min_dist < threshold {
- let delta = threshold + 1.0;
- let left = dist_left < delta;
- let right = dist_right < delta;
- let top = dist_top < delta;
- let bottom = dist_bottom < delta;
+ let corner_threshold = bw + 2.0;
+ let left = dist_left < corner_threshold;
+ let right = dist_right < corner_threshold;
+ let top = dist_top < corner_threshold;
+ let bottom = dist_bottom < corner_threshold;
- return BorderZone::Resize(crate::window::Edges { top, bottom, left, right });
- } else {
- return BorderZone::Move;
- }
+ return BorderZone::Resize(crate::window::Edges { top, bottom, left, right });
}
BorderZone::None