diff options
author | Chong Yidong <cyd@gnu.org> | 2012-11-24 16:15:00 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-11-24 16:15:00 +0800 |
commit | 0c5ef1333558423f0eb0f14934fffb1b4bce0946 (patch) | |
tree | f77272e88bb4aad7f64201c548efa2de4131e3e0 /lisp/mouse.el | |
parent | 22294a56e8115801f7b515f71ca87342d3e2e558 (diff) | |
download | emacs-0c5ef1333558423f0eb0f14934fffb1b4bce0946.tar.gz |
Fix follow-mouse clicks on undraggable mode/header lines.
* mouse.el (mouse-drag-line): Even if the line is not draggable,
keep reading until we get the up-event anyway, in order to process
the up-event for mouse-1-click-follows-link.
Fixes: debbugs:12971
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 61d70404bd6..60a3d390889 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -425,7 +425,7 @@ must be one of the symbols `header', `mode', or `vertical'." (frame-parameters frame))) 'right))) (draggable t) - event position growth dragged) + finished event position growth dragged) (cond ((eq line 'header) ;; Check whether header-line can be dragged at all. @@ -457,7 +457,7 @@ must be one of the symbols `header', `mode', or `vertical'." ;; Start tracking. (track-mouse ;; Loop reading events and sampling the position of the mouse. - (while draggable + (while (not finished) (setq event (read-event)) (setq position (mouse-position)) ;; Do nothing if @@ -472,7 +472,7 @@ must be one of the symbols `header', `mode', or `vertical'." ;; - there is a keyboard event or some other unknown event. (cond ((not (consp event)) - (setq draggable nil)) + (setq finished t)) ((memq (car event) '(switch-frame select-window)) nil) ((not (memq (car event) '(mouse-movement scroll-bar-movement))) @@ -480,15 +480,15 @@ must be one of the symbols `header', `mode', or `vertical'." ;; Do not unread a drag-mouse-1 event to avoid selecting ;; some other window. For vertical line dragging do not ;; unread mouse-1 events either (but only if we dragged at - ;; least once to allow mouse-1 clicks get through. + ;; least once to allow mouse-1 clicks get through). (unless (and dragged (if (eq line 'vertical) (memq (car event) '(drag-mouse-1 mouse-1)) (eq (car event) 'drag-mouse-1))) (push event unread-command-events))) - (setq draggable nil)) - ((or (not (eq (car position) frame)) - (null (car (cdr position)))) + (setq finished t)) + ((not (and (eq (car position) frame) + (cadr position))) nil) ((eq line 'vertical) ;; Drag vertical divider. |