From d6b1dd9193b247f52b6815d39653a2ea729f5477 Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Sun, 24 Mar 2013 16:50:54 +0100 Subject: [PATCH] Beginning of sloppy select over all windows --- src/clfswm.lisp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/clfswm.lisp b/src/clfswm.lisp index 34f50ad..c874b09 100644 --- a/src/clfswm.lisp +++ b/src/clfswm.lisp @@ -133,12 +133,29 @@ (:sloppy-select (let* ((child (find-child-under-mouse root-x root-y)) (parent (find-parent-frame child))) (unless (or (child-root-p child) - (equal (typecase child - (xlib:window parent) - (t child)) - (current-child))) + (child-equal-p (typecase child + (xlib:window parent) + (t child)) + (current-child))) (focus-all-children child parent) - (show-all-children))))))) + (show-all-children)))) + (:sloppy-select-window (let* ((child (find-child-under-mouse root-x root-y)) + (parent (find-parent-frame child)) + (need-warp-pointer (not (or (frame-p child) + (child-equal-p child (frame-selected-child parent)))))) + (unless (child-root-p child) + (when (focus-all-children child parent) + (show-all-children) + (when need-warp-pointer + (typecase child + (xlib:window (xlib:warp-pointer *root* + (truncate (+ (x-drawable-x child) + (/ (x-drawable-width child) 2))) + (truncate (+ (x-drawable-y child) + (/ (x-drawable-height child) 2))))) + (frame (xlib:warp-pointer *root* + (+ (frame-rx child) 10) + (+ (frame-ry child) 10)))))))))))) (define-handler main-mode :exposure (window) (awhen (find-frame-window window) -- 2.11.4.GIT