- ;; Loop reading events and sampling the position of the mouse.
- (while (not done)
- (setq event (read-event))
- (setq mouse (mouse-position))
+ ;; Loop reading events and sampling the position of the mouse,
+ ;; until there is a non-mouse-movement event. Also,
+ ;; scroll-bar-movement events are the same as mouse movement for
+ ;; our purposes. (Why? -- cyd)
+ ;; If you change this, check that all of the following still work:
+ ;; Resizing windows by dragging mode-lines and header lines,
+ ;; and vertical lines (in windows without scroll bars).
+ ;; Doing this should not select another window, even if
+ ;; mouse-autoselect-window is non-nil.
+ ;; Mouse-1 clicks in Info header lines should advance position
+ ;; by one node at a time if mouse-1-click-follows-link is non-nil,
+ ;; otherwise they should just select the window.
+ (while (progn
+ (setq event (read-event))
+ (memq (car-safe event)
+ '(mouse-movement scroll-bar-movement
+ switch-frame select-window)))
+ (setq position (mouse-position))