From ff653e78afcbcc185788b676d07e78e2db3772f0 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 6 Aug 2024 13:59:03 -0700 Subject: [PATCH] fix(wm): mouse resize on right and bottom edges Addresses a regression introduced somewhere along the way in changing how borders and rects sizes are calculated. Need to come back and see if the constant calculated with the mix of BORDER_WIDTH and BORDER_OFFSET is still relevant anymore. fix #942 --- komorebi/src/process_event.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index 95512349..ef68d9ae 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -586,14 +586,19 @@ impl WindowManager { ops.push(resize_op!(resize.top, >, OperationDirection::Up)); } + // TODO: Determine if this is still needed let top_left_constant = BORDER_WIDTH.load(Ordering::SeqCst) + BORDER_OFFSET.load(Ordering::SeqCst); - if resize.right != 0 && resize.left == top_left_constant { + if resize.right != 0 + && (resize.left == top_left_constant || resize.left == 0) + { ops.push(resize_op!(resize.right, <, OperationDirection::Right)); } - if resize.bottom != 0 && resize.top == top_left_constant { + if resize.bottom != 0 + && (resize.top == top_left_constant || resize.top == 0) + { ops.push(resize_op!(resize.bottom, <, OperationDirection::Down)); }