# HG changeset patch # User Richard M. Stallman # Date 1158593990 0 # Node ID 1a9df4096f4e4dba77668b539f846b454a431ae0 # Parent 3b2d4cd42aaa527b44d62ce11399c83b920b208f (widget-button-click): Handle non-mouse-motion events that might come in during mouse tracking. diff -r 3b2d4cd42aaa -r 1a9df4096f4e lisp/wid-edit.el --- 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.