From 0fdbf6bc76533b093a74318d8ac6256a93e4c43a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 18 Sep 2006 15:39:50 +0000 Subject: [PATCH] (widget-button-click): Handle non-mouse-motion events that might come in during mouse tracking. --- lisp/wid-edit.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index fc64dd5f361..e518fff34fa 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -959,15 +959,18 @@ Recommended as a parent keymap for modes using widgets.") (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. -- 2.39.2