diff options
| author | Chong Yidong | 2012-11-24 16:15:00 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-11-24 16:15:00 +0800 |
| commit | 0c5ef1333558423f0eb0f14934fffb1b4bce0946 (patch) | |
| tree | f77272e88bb4aad7f64201c548efa2de4131e3e0 | |
| parent | 22294a56e8115801f7b515f71ca87342d3e2e558 (diff) | |
| download | emacs-0c5ef1333558423f0eb0f14934fffb1b4bce0946.tar.gz emacs-0c5ef1333558423f0eb0f14934fffb1b4bce0946.zip | |
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
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/mouse.el | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 431f45c3695..04aa1dc0216 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-11-24 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * mouse.el (mouse-drag-line): Even if the line is not draggable, | ||
| 4 | keep reading until we get the up-event anyway, in order to process | ||
| 5 | the up-event for mouse-1-click-follows-link (Bug#12971). | ||
| 6 | |||
| 1 | 2012-11-23 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2012-11-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-file): Setup default value for | 9 | * emacs-lisp/bytecomp.el (byte-compile-file): Setup default value for |
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'." | |||
| 425 | (frame-parameters frame))) | 425 | (frame-parameters frame))) |
| 426 | 'right))) | 426 | 'right))) |
| 427 | (draggable t) | 427 | (draggable t) |
| 428 | event position growth dragged) | 428 | finished event position growth dragged) |
| 429 | (cond | 429 | (cond |
| 430 | ((eq line 'header) | 430 | ((eq line 'header) |
| 431 | ;; Check whether header-line can be dragged at all. | 431 | ;; Check whether header-line can be dragged at all. |
| @@ -457,7 +457,7 @@ must be one of the symbols `header', `mode', or `vertical'." | |||
| 457 | ;; Start tracking. | 457 | ;; Start tracking. |
| 458 | (track-mouse | 458 | (track-mouse |
| 459 | ;; Loop reading events and sampling the position of the mouse. | 459 | ;; Loop reading events and sampling the position of the mouse. |
| 460 | (while draggable | 460 | (while (not finished) |
| 461 | (setq event (read-event)) | 461 | (setq event (read-event)) |
| 462 | (setq position (mouse-position)) | 462 | (setq position (mouse-position)) |
| 463 | ;; Do nothing if | 463 | ;; Do nothing if |
| @@ -472,7 +472,7 @@ must be one of the symbols `header', `mode', or `vertical'." | |||
| 472 | ;; - there is a keyboard event or some other unknown event. | 472 | ;; - there is a keyboard event or some other unknown event. |
| 473 | (cond | 473 | (cond |
| 474 | ((not (consp event)) | 474 | ((not (consp event)) |
| 475 | (setq draggable nil)) | 475 | (setq finished t)) |
| 476 | ((memq (car event) '(switch-frame select-window)) | 476 | ((memq (car event) '(switch-frame select-window)) |
| 477 | nil) | 477 | nil) |
| 478 | ((not (memq (car event) '(mouse-movement scroll-bar-movement))) | 478 | ((not (memq (car event) '(mouse-movement scroll-bar-movement))) |
| @@ -480,15 +480,15 @@ must be one of the symbols `header', `mode', or `vertical'." | |||
| 480 | ;; Do not unread a drag-mouse-1 event to avoid selecting | 480 | ;; Do not unread a drag-mouse-1 event to avoid selecting |
| 481 | ;; some other window. For vertical line dragging do not | 481 | ;; some other window. For vertical line dragging do not |
| 482 | ;; unread mouse-1 events either (but only if we dragged at | 482 | ;; unread mouse-1 events either (but only if we dragged at |
| 483 | ;; least once to allow mouse-1 clicks get through. | 483 | ;; least once to allow mouse-1 clicks get through). |
| 484 | (unless (and dragged | 484 | (unless (and dragged |
| 485 | (if (eq line 'vertical) | 485 | (if (eq line 'vertical) |
| 486 | (memq (car event) '(drag-mouse-1 mouse-1)) | 486 | (memq (car event) '(drag-mouse-1 mouse-1)) |
| 487 | (eq (car event) 'drag-mouse-1))) | 487 | (eq (car event) 'drag-mouse-1))) |
| 488 | (push event unread-command-events))) | 488 | (push event unread-command-events))) |
| 489 | (setq draggable nil)) | 489 | (setq finished t)) |
| 490 | ((or (not (eq (car position) frame)) | 490 | ((not (and (eq (car position) frame) |
| 491 | (null (car (cdr position)))) | 491 | (cadr position))) |
| 492 | nil) | 492 | nil) |
| 493 | ((eq line 'vertical) | 493 | ((eq line 'vertical) |
| 494 | ;; Drag vertical divider. | 494 | ;; Drag vertical divider. |