aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-04-16 06:47:20 +0000
committerKarl Heuer1994-04-16 06:47:20 +0000
commit50e527bcc93db91e88d9529f41ff609d486ba413 (patch)
tree36b9017ecf5ce45e09d0de878956a38e84806d09
parent6e8631341969a4bb97e5ba7130f603afa54d16a7 (diff)
downloademacs-50e527bcc93db91e88d9529f41ff609d486ba413.tar.gz
emacs-50e527bcc93db91e88d9529f41ff609d486ba413.zip
(mouse-drag-region): Handle scroll off top/bottom.
-rw-r--r--lisp/mouse.el22
1 files changed, 4 insertions, 18 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 37dec0fa498..f60955a4907 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -236,31 +236,17 @@ release the mouse button. Otherwise, it does not."
236 (let ((range (mouse-start-end start-point (point) click-count))) 236 (let ((range (mouse-start-end start-point (point) click-count)))
237 (move-overlay mouse-drag-overlay (car range) (nth 1 range)))) 237 (move-overlay mouse-drag-overlay (car range) (nth 1 range))))
238 238
239 ;; Are we moving on a different window on the same frame? 239 (t
240 ((and (windowp (posn-window end)) 240 (let ((mouse-row (cdr (cdr (mouse-position)))))
241 (eq (window-frame (posn-window end)) start-frame))
242 (let ((mouse-row
243 (+ (nth 1 (window-edges (posn-window end)))
244 (cdr (posn-col-row end)))))
245 (cond 241 (cond
242 ((null mouse-row))
246 ((< mouse-row top) 243 ((< mouse-row top)
247 (mouse-scroll-subr 244 (mouse-scroll-subr
248 (- mouse-row top) mouse-drag-overlay start-point)) 245 (- mouse-row top) mouse-drag-overlay start-point))
249 ((and (not (eobp)) 246 ((and (not (eobp))
250 (>= mouse-row bottom)) 247 (>= mouse-row bottom))
251 (mouse-scroll-subr (1+ (- mouse-row bottom)) 248 (mouse-scroll-subr (1+ (- mouse-row bottom))
252 mouse-drag-overlay start-point))))) 249 mouse-drag-overlay start-point)))))))))
253
254 (t
255 (let ((mouse-y (cdr (cdr (mouse-position))))
256 (menu-bar-lines (or (cdr (assq 'menu-bar-lines
257 (frame-parameters)))
258 0)))
259
260 ;; Are we on the menu bar?
261 (and (integerp mouse-y) (< mouse-y menu-bar-lines)
262 (mouse-scroll-subr (- mouse-y menu-bar-lines)
263 mouse-drag-overlay start-point))))))))
264 250
265 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) 251 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click)
266 (eq (posn-window (event-end event)) start-window) 252 (eq (posn-window (event-end event)) start-window)