Mercurial > emacs
changeset 72959:1a9df4096f4e
(widget-button-click): Handle non-mouse-motion events
that might come in during mouse tracking.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 18 Sep 2006 15:39:50 +0000 |
parents | 3b2d4cd42aaa |
children | d26e5ae15bb9 |
files | lisp/wid-edit.el |
diffstat | 1 files changed, 12 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/wid-edit.el Mon Sep 18 14:16:07 2006 +0000 +++ b/lisp/wid-edit.el Mon Sep 18 15:39:50 2006 +0000 @@ -959,15 +959,18 @@ (push event unread-command-events) (setq event oevent) (throw 'button-press-cancelled t)) - (setq pos (widget-event-point event)) - (if (and pos - (eq (get-char-property pos 'button) - button)) - (when face - (overlay-put overlay 'face pressed-face) - (overlay-put overlay 'mouse-face pressed-face)) - (overlay-put overlay 'face face) - (overlay-put overlay 'mouse-face mouse-face))))) + (unless (or (integerp event) + (memq (car event) '(switch-frame select-window)) + (eq (car event) 'scroll-bar-movement)) + (setq pos (widget-event-point event)) + (if (and pos + (eq (get-char-property pos 'button) + button)) + (when face + (overlay-put overlay 'face pressed-face) + (overlay-put overlay 'mouse-face pressed-face)) + (overlay-put overlay 'face face) + (overlay-put overlay 'mouse-face mouse-face)))))) ;; When mouse is released over the button, run ;; its action function.