summaryrefslogtreecommitdiff
path: root/lisp/mouse-drag.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2001-11-17 22:37:39 +0000
committerRichard M. Stallman <rms@gnu.org>2001-11-17 22:37:39 +0000
commite35afc9744c14b12e0a9960ffb3278e3a31a2e1d (patch)
treefac31b5ed46726d7f98c75c920f1f7cc2feb7a27 /lisp/mouse-drag.el
parent75547194d378932a1f0edb28c6bb078ec73cfb45 (diff)
downloademacs-e35afc9744c14b12e0a9960ffb3278e3a31a2e1d.tar.gz
(mouse-drag-throw): Push back non-drag events
into `unread-command-events' instead of trying keymap lookups ourselves. This makes mouse-clicks do the right thing even when keymaps of overlays are involved. (mouse-drag-drag): Likewise.
Diffstat (limited to 'lisp/mouse-drag.el')
-rw-r--r--lisp/mouse-drag.el31
1 files changed, 11 insertions, 20 deletions
diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el
index 9affe8b488c..50b248a9ec3 100644
--- a/lisp/mouse-drag.el
+++ b/lisp/mouse-drag.el
@@ -208,7 +208,7 @@ To test this function, evaluate:
(start-col (car (posn-col-row start-posn)))
(old-selected-window (selected-window))
event end row mouse-delta scroll-delta
- have-scrolled point-event-p old-binding
+ have-scrolled
window-last-row
col mouse-col-delta window-last-col
(scroll-col-delta 0)
@@ -261,18 +261,13 @@ To test this function, evaluate:
(mouse-drag-safe-scroll scroll-delta scroll-col-delta)
(mouse-drag-repeatedly-safe-scroll scroll-delta scroll-col-delta))))) ;xxx
;; If it was a click and not a drag, prepare to pass the event on.
- ;; Note: We must determine the pass-through event before restoring
- ;; the window, but invoke it after. Sigh.
+ ;; Is there a more correct way to reconstruct the event?
(if (and (not have-scrolled)
(mouse-drag-events-are-point-events-p start-posn end))
- (setq point-event-p t
- old-binding (key-binding
- (vector (event-basic-type start-event)))))
+ (push (cons (event-basic-type start-event) (cdr start-event))
+ unread-command-events))
;; Now restore the old window.
- (select-window old-selected-window)
- ;; For clicks, call the old function.
- (if point-event-p
- (call-interactively old-binding))))
+ (select-window old-selected-window)))
(defun mouse-drag-drag (start-event)
"\"Drag\" the page according to a mouse drag.
@@ -297,7 +292,7 @@ To test this function, evaluate:
(start-col (car (posn-col-row start-posn)))
(old-selected-window (selected-window))
event end row mouse-delta scroll-delta
- have-scrolled point-event-p old-binding
+ have-scrolled
window-last-row
col mouse-col-delta window-last-col
(scroll-col-delta 0)
@@ -335,18 +330,14 @@ To test this function, evaluate:
(setq have-scrolled t)
(mouse-drag-safe-scroll scroll-delta scroll-col-delta)))))))
;; If it was a click and not a drag, prepare to pass the event on.
- ;; Note: We must determine the pass-through event before restoring
- ;; the window, but invoke it after. Sigh.
+ ;; Is there a more correct way to reconstruct the event?
(if (and (not have-scrolled)
(mouse-drag-events-are-point-events-p start-posn end))
- (setq point-event-p t
- old-binding (key-binding
- (vector (event-basic-type start-event)))))
+ (push (cons (event-basic-type start-event) (cdr start-event))
+ unread-command-events))
;; Now restore the old window.
- (select-window old-selected-window)
- ;; For clicks, call the old function.
- (if point-event-p
- (call-interactively old-binding))))
+ (select-window old-selected-window)))
+
(provide 'mouse-drag)