Use in-child to find child under mouse pointer
authorPhilippe Brochard <pbrochard@common-lisp.net>
Sun, 24 Mar 2013 08:11:52 +0000 (24 09:11 +0100)
committerPhilippe Brochard <pbrochard@common-lisp.net>
Sun, 24 Mar 2013 08:11:52 +0000 (24 09:11 +0100)
src/clfswm-util.lisp

index 56a2a85..9440d58 100644 (file)
@@ -367,10 +367,8 @@ Write (defparameter *contrib-dir* \"/usr/local/lib/clfswm/\") in ~A.~%"
 
 (defun find-child-under-mouse-in-child-tree (x y)
   (dolist (child-rect (get-displayed-child))
-    (let ((child (child-rect-child child-rect)))
-      (when (in-rect x y (x-drawable-x child) (x-drawable-y child)
-                   (x-drawable-width child) (x-drawable-height child))
-        (return-from find-child-under-mouse-in-child-tree (child-rect-child child-rect))))))
+    (when (in-child (child-rect-child child-rect) x y)
+      (return-from find-child-under-mouse-in-child-tree (child-rect-child child-rect)))))