From a9f7310463adf8c9ef4ae402fc17bfcae5fd5c5f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 24 Jul 2001 11:05:40 +0000 Subject: [PATCH] (mouse-avoidance-too-close-p): If the frame lacks a tool-bar-lines parameter, behave as if its value were zero. (mouse-avoidance-set-pointer-shape): Don't do anything if x-pointer-shape is not boundp. --- lisp/ChangeLog | 7 +++++++ lisp/avoid.el | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d27973d115a..b6c7f227671 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2001-07-24 Eli Zaretskii + + * avoid.el (mouse-avoidance-too-close-p): If the frame lacks a + tool-bar-lines parameter, behave as if its value were zero. + (mouse-avoidance-set-pointer-shape): Don't do anything if + x-pointer-shape is not boundp. + 2001-07-23 Francesco Potorti` * uniquify.el: Overall speedup changes when using many buffers. diff --git a/lisp/avoid.el b/lisp/avoid.el index 2aa2b28f1c3..4bc59de14a7 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -131,8 +131,9 @@ Only applies in mouse-avoidance-modes `animate' and `jump'." (defsubst mouse-avoidance-set-pointer-shape (shape) "Set the shape of the mouse pointer to SHAPE." - (setq x-pointer-shape shape) - (set-mouse-color nil)) + (when (boundp 'x-pointer-shape) + (setq x-pointer-shape shape) + (set-mouse-color nil))) (defun mouse-avoidance-point-position () "Return the position of point as (FRAME X . Y). @@ -179,6 +180,8 @@ Acceptable distance is defined by `mouse-avoidance-threshold'." (let* ((frame (car mouse)) (mouse-y (cdr (cdr mouse))) (tool-bar-lines (frame-parameter nil 'tool-bar-lines))) + (or tool-bar-lines + (setq tool-bar-lines 0)) (if (and mouse-y (< mouse-y tool-bar-lines)) nil (let ((point (mouse-avoidance-point-position)) @@ -386,7 +389,8 @@ definition of \"random distance\".)" (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy-hook)) (setq mouse-avoidance-mode mode mouse-avoidance-state (cons 0 0) - mouse-avoidance-old-pointer-shape x-pointer-shape)) + mouse-avoidance-old-pointer-shape + (and (boundp 'x-pointer-shape) x-pointer-shape))) ((eq mode 'exile) (setq mouse-avoidance-timer (run-with-idle-timer 0.1 t 'mouse-avoidance-exile-hook))