comparison lisp/mouse.el @ 7588:4a0b3a63e51e

(mouse-drag-secondary): Handle mouse motion out of window as in mouse-drag-region.
author Richard M. Stallman <rms@gnu.org>
date Fri, 20 May 1994 08:46:20 +0000
parents f35fe65c9755
children a837cfdcf7c0
comparison
equal deleted inserted replaced
7587:efaee8861ad4 7588:4a0b3a63e51e
627 (set-marker mouse-secondary-start nil)) 627 (set-marker mouse-secondary-start nil))
628 (let ((range (mouse-start-end start-point end-point 628 (let ((range (mouse-start-end start-point end-point
629 click-count))) 629 click-count)))
630 (move-overlay mouse-secondary-overlay 630 (move-overlay mouse-secondary-overlay
631 (car range) (nth 1 range)))) 631 (car range) (nth 1 range))))
632 632 (t
633 ;; Are we moving on a different window on the same frame? 633 (let ((mouse-row (cdr (cdr (mouse-position)))))
634 ((and (windowp (posn-window end)) 634 (cond
635 (eq (window-frame (posn-window end)) start-frame)) 635 ((null mouse-row))
636 (let ((mouse-row 636 ((< mouse-row top)
637 (+ (nth 1 (window-edges (posn-window end))) 637 (mouse-scroll-subr
638 (cdr (posn-col-row end))))) 638 (- mouse-row top) mouse-secondary-overlay start-point))
639 (cond 639 ((and (not (eobp))
640 ((< mouse-row top) 640 (>= mouse-row bottom))
641 (mouse-scroll-subr 641 (mouse-scroll-subr (1+ (- mouse-row bottom))
642 (- mouse-row top) mouse-secondary-overlay start-point)) 642 mouse-secondary-overlay start-point)))))))))
643 ((and (not (eobp))
644 (>= mouse-row bottom))
645 (mouse-scroll-subr (1+ (- mouse-row bottom))
646 mouse-drag-overlay start-point)))))
647
648 (t
649 (let ((mouse-y (cdr (cdr (mouse-position))))
650 (menu-bar-lines (or (cdr (assq 'menu-bar-lines
651 (frame-parameters)))
652 0)))
653
654 ;; Are we on the menu bar?
655 (and (integerp mouse-y) (< mouse-y menu-bar-lines)
656 (mouse-scroll-subr (- mouse-y menu-bar-lines)
657 mouse-secondary-overlay start-point))))))))
658 643
659 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) 644 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click)
660 (eq (posn-window (event-end event)) start-window) 645 (eq (posn-window (event-end event)) start-window)
661 (numberp (posn-point (event-end event)))) 646 (numberp (posn-point (event-end event))))
662 (if (marker-position mouse-secondary-start) 647 (if (marker-position mouse-secondary-start)