]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent errant scroll on mouse click (Bug#31546)
authorAaron Jensen <aaronjensen@gmail.com>
Thu, 24 May 2018 10:45:03 +0000 (03:45 -0700)
committerAlan Third <alan@idiocy.org>
Sun, 17 Jun 2018 10:50:57 +0000 (11:50 +0100)
* 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
src/nsterm.m

index 9a3e2235ece074e87aebf8d143946781ab81cdbb..5c9056fb43d1889afa6ef2a901d66efc74f197a2 100644 (file)
@@ -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))))
index e4a9b014f4900f341a3eca6abbf4b733bed51e2e..1afd637b61996d00a3eba18d688b5774103a692f 100644 (file)
@@ -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];