diff options
| author | Aaron Jensen | 2018-05-24 03:45:03 -0700 |
|---|---|---|
| committer | Alan Third | 2018-06-17 11:50:57 +0100 |
| commit | ebe065fddf76fde64a9c07b419b67fe47fb6c1cb (patch) | |
| tree | 9bc1e2ed312704df5347bfc707bb3485a71c5552 | |
| parent | ffd20184ca9bb026064f28aa260f2298baeb7fc8 (diff) | |
| download | emacs-ebe065fddf76fde64a9c07b419b67fe47fb6c1cb.tar.gz emacs-ebe065fddf76fde64a9c07b419b67fe47fb6c1cb.zip | |
Prevent errant scroll on mouse click (Bug#31546)
* src/nsterm.m (ns_mouse_position): Use correct frame when determining
mouse position.
* lisp/mouse.el (mouse-drag-track): Only account for mode-line height
if `mode-line-format' is non-nil.
| -rw-r--r-- | lisp/mouse.el | 6 | ||||
| -rw-r--r-- | src/nsterm.m | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 9a3e2235ece..5c9056fb43d 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -1225,7 +1225,11 @@ The region will be defined with mark and point." | |||
| 1225 | (bounds (window-edges start-window)) | 1225 | (bounds (window-edges start-window)) |
| 1226 | (make-cursor-line-fully-visible nil) | 1226 | (make-cursor-line-fully-visible nil) |
| 1227 | (top (nth 1 bounds)) | 1227 | (top (nth 1 bounds)) |
| 1228 | (bottom (if (window-minibuffer-p start-window) | 1228 | (bottom (if (or (window-minibuffer-p start-window) |
| 1229 | ;; Do not account for the mode line if there | ||
| 1230 | ;; is no mode line, which is common for child | ||
| 1231 | ;; frames. | ||
| 1232 | (not mode-line-format)) | ||
| 1229 | (nth 3 bounds) | 1233 | (nth 3 bounds) |
| 1230 | ;; Don't count the mode line. | 1234 | ;; Don't count the mode line. |
| 1231 | (1- (nth 3 bounds)))) | 1235 | (1- (nth 3 bounds)))) |
diff --git a/src/nsterm.m b/src/nsterm.m index e4a9b014f49..1afd637b619 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -2547,7 +2547,7 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, | |||
| 2547 | 2547 | ||
| 2548 | if (f && FRAME_NS_P (f)) | 2548 | if (f && FRAME_NS_P (f)) |
| 2549 | { | 2549 | { |
| 2550 | view = FRAME_NS_VIEW (*fp); | 2550 | view = FRAME_NS_VIEW (f); |
| 2551 | 2551 | ||
| 2552 | position = [[view window] mouseLocationOutsideOfEventStream]; | 2552 | position = [[view window] mouseLocationOutsideOfEventStream]; |
| 2553 | position = [view convertPoint: position fromView: nil]; | 2553 | position = [view convertPoint: position fromView: nil]; |