[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 ebe065f 1/3: Prevent errant scroll on mouse click
From: |
Alan Third |
Subject: |
[Emacs-diffs] emacs-26 ebe065f 1/3: Prevent errant scroll on mouse click (Bug#31546) |
Date: |
Sun, 17 Jun 2018 07:07:03 -0400 (EDT) |
branch: emacs-26
commit ebe065fddf76fde64a9c07b419b67fe47fb6c1cb
Author: Aaron Jensen <address@hidden>
Commit: Alan Third <address@hidden>
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.
---
lisp/mouse.el | 6 +++++-
src/nsterm.m | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 9a3e223..5c9056f 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1225,7 +1225,11 @@ The region will be defined with mark and point."
(bounds (window-edges start-window))
(make-cursor-line-fully-visible nil)
(top (nth 1 bounds))
- (bottom (if (window-minibuffer-p start-window)
+ (bottom (if (or (window-minibuffer-p start-window)
+ ;; Do not account for the mode line if there
+ ;; is no mode line, which is common for child
+ ;; frames.
+ (not mode-line-format))
(nth 3 bounds)
;; Don't count the mode line.
(1- (nth 3 bounds))))
diff --git a/src/nsterm.m b/src/nsterm.m
index e4a9b01..1afd637 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,
if (f && FRAME_NS_P (f))
{
- view = FRAME_NS_VIEW (*fp);
+ view = FRAME_NS_VIEW (f);
position = [[view window] mouseLocationOutsideOfEventStream];
position = [view convertPoint: position fromView: nil];