aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/avoid.el
diff options
context:
space:
mode:
authorGerd Moellmann2000-11-23 14:23:28 +0000
committerGerd Moellmann2000-11-23 14:23:28 +0000
commit02790ce2e061b8e91c8afc2bdc4c08a054270b6e (patch)
tree73842cbf25d5fd6cdf58f5019ac758cab864bdff /lisp/avoid.el
parent595dead24f51441813e5ccda956e9f741feff275 (diff)
downloademacs-02790ce2e061b8e91c8afc2bdc4c08a054270b6e.tar.gz
emacs-02790ce2e061b8e91c8afc2bdc4c08a054270b6e.zip
(mouse-avoidance-too-close-p): Return nil if mouse
is in the tool bar.
Diffstat (limited to 'lisp/avoid.el')
-rw-r--r--lisp/avoid.el27
1 files changed, 17 insertions, 10 deletions
diff --git a/lisp/avoid.el b/lisp/avoid.el
index 1f01eced204..2aa2b28f1c3 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -1,6 +1,6 @@
1;;; avoid.el --- make mouse pointer stay out of the way of editing 1;;; avoid.el --- make mouse pointer stay out of the way of editing
2 2
3;;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. 3;;; Copyright (C) 1993, 1994, 2000 Free Software Foundation, Inc.
4 4
5;; Author: Boris Goldowsky <boris@gnu.org> 5;; Author: Boris Goldowsky <boris@gnu.org>
6;; Keywords: mouse 6;; Keywords: mouse
@@ -173,15 +173,22 @@ Analogous to mouse-position."
173 t)) 173 t))
174 174
175(defun mouse-avoidance-too-close-p (mouse) 175(defun mouse-avoidance-too-close-p (mouse)
176 ;; Return t if mouse pointer and point cursor are too close. 176 "Return t if mouse pointer and point cursor are too close.
177 ;; Acceptable distance is defined by mouse-avoidance-threshold. 177MOUSE is the current mouse position as returned by `mouse-position'.
178 (let ((point (mouse-avoidance-point-position))) 178Acceptable distance is defined by `mouse-avoidance-threshold'."
179 (and (eq (car mouse) (car point)) 179 (let* ((frame (car mouse))
180 (car (cdr mouse)) 180 (mouse-y (cdr (cdr mouse)))
181 (< (abs (- (car (cdr mouse)) (car (cdr point)))) 181 (tool-bar-lines (frame-parameter nil 'tool-bar-lines)))
182 mouse-avoidance-threshold) 182 (if (and mouse-y (< mouse-y tool-bar-lines))
183 (< (abs (- (cdr (cdr mouse)) (cdr (cdr point)))) 183 nil
184 mouse-avoidance-threshold)))) 184 (let ((point (mouse-avoidance-point-position))
185 (mouse-x (car (cdr mouse))))
186 (and (eq frame (car point))
187 (not (null mouse-x))
188 (< (abs (- mouse-x (car (cdr point))))
189 mouse-avoidance-threshold)
190 (< (abs (- mouse-y (cdr (cdr point))))
191 mouse-avoidance-threshold))))))
185 192
186(defun mouse-avoidance-banish-destination () 193(defun mouse-avoidance-banish-destination ()
187 "The position to which mouse-avoidance-mode `banish' moves the mouse. 194 "The position to which mouse-avoidance-mode `banish' moves the mouse.