From 0c3cd2d6a7093bfaa9b60d711c54a79a02c55ff5 Mon Sep 17 00:00:00 2001 From: cage Date: Sat, 5 Mar 2022 14:33:03 +0100 Subject: [PATCH] - fixed moving the focus between windows using ALT-arrow. --- src/ui-goodies.lisp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/ui-goodies.lisp b/src/ui-goodies.lisp index 1ce48aa..f2c2734 100644 --- a/src/ui-goodies.lisp +++ b/src/ui-goodies.lisp @@ -431,7 +431,8 @@ Metadata includes: (setf (windows:in-focus win) t) (windows:draw-all) (when info-change-focus-message - (info-message info-change-focus-message +maximum-event-priority+))) + (info-message info-change-focus-message +maximum-event-priority+)) + win) (defun remove-focus-to-all-windows () (stack:do-stack-element (window windows::*window-stack*) @@ -453,7 +454,8 @@ Metadata includes: intersect-sorted)) (when intersect-sorted (remove-focus-to-all-windows) - (give-focus (first-elt intersect-sorted) nil)))) + (give-focus (first-elt intersect-sorted) nil) + t))) (defun pinned-window-p (window) (member window @@ -491,7 +493,7 @@ current has focus" (intersect-fn (w) (<= (win-y w) y-focused - (+ (win-y w) (win-height w)))) + (1- (+ (win-y w) (win-height w))))) (sort-predicate (a b) (< (win-y a) (win-y b)))) (pass-focus #'all-adjacent-fn #'intersect-fn #'sort-predicate))))) @@ -518,14 +520,15 @@ current has focus" (when (not (window-focused-pinned-p)) (let* ((window (main-window:focused-window *main-window*)) (x-focused (win-x window)) - (y-focused (win-y window))) + (y-focused (win-y window)) + (w-focused (win-height window))) (labels ((all-adjacent-fn (w) (> (win-y w) - y-focused)) + (1- (+ y-focused w-focused)))) (intersect-fn (w) (<= (win-x w) x-focused - (+ (win-x w) (win-width w)))) + (1- (+ (win-x w) (win-width w))))) (sort-predicate (a b) (> (win-x a) (win-x b)))) (pass-focus #'all-adjacent-fn #'intersect-fn #'sort-predicate))))) @@ -542,7 +545,7 @@ current has focus" (intersect-fn (w) (<= (win-x w) x-focused - (+ (win-x w) (win-width w)))) + (1- (+ (win-x w) (win-width w))))) (sort-predicate (a b) (> (win-x a) (win-x b)))) (pass-focus #'all-adjacent-fn #'intersect-fn #'sort-predicate)))))