aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorCharles A. Roelli2017-05-18 21:31:46 +0200
committerAlan Third2017-05-21 00:09:41 +0100
commit7e5a8cdceb408077df78b1ea810b1f5d4657303d (patch)
tree0b8ec76811bc1e66aa3fbfa5ad594a3e6cbb302a /lisp
parentc969b3997168de2bbe781fbcb08b67b15eddc02d (diff)
downloademacs-7e5a8cdceb408077df78b1ea810b1f5d4657303d.tar.gz
emacs-7e5a8cdceb408077df78b1ea810b1f5d4657303d.zip
Fix macOS mouse movement
* lisp/frame.el (ns-set-mouse-absolute-pixel-position): New function (Lisp). (set-mouse-absolute-pixel-position): Change it to call `ns-set-mouse-absolute-pixel-position' on macOS. * src/nsfns.m (Fns_set_mouse_absolute_pixel_position): New function. * src/nsterm.h (NS_PARENT_WINDOW_TOP_POS): Use the primary screen's height as a base for calculating global coordinates. * src/nsterm.m (frame_set_mouse_pixel_position): Fix it in macOS. * test/lisp/mouse-tests.el (bug26816-mouse-frame-movement): Test movement of mouse relative to frame.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/frame.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 05db8cf6fd4..02871e0551d 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1465,6 +1465,7 @@ position (0, 0) of the selected frame's terminal."
1465 (t 1465 (t
1466 (cons 0 0))))) 1466 (cons 0 0)))))
1467 1467
1468(declare-function ns-set-mouse-absolute-pixel-position "nsfns.m" (x y))
1468(declare-function w32-set-mouse-absolute-pixel-position "w32fns.c" (x y)) 1469(declare-function w32-set-mouse-absolute-pixel-position "w32fns.c" (x y))
1469(declare-function x-set-mouse-absolute-pixel-position "xfns.c" (x y)) 1470(declare-function x-set-mouse-absolute-pixel-position "xfns.c" (x y))
1470 1471
@@ -1474,6 +1475,8 @@ The coordinates X and Y are interpreted in pixels relative to a
1474position (0, 0) of the selected frame's terminal." 1475position (0, 0) of the selected frame's terminal."
1475 (let ((frame-type (framep-on-display))) 1476 (let ((frame-type (framep-on-display)))
1476 (cond 1477 (cond
1478 ((eq frame-type 'ns)
1479 (ns-set-mouse-absolute-pixel-position x y))
1477 ((eq frame-type 'x) 1480 ((eq frame-type 'x)
1478 (x-set-mouse-absolute-pixel-position x y)) 1481 (x-set-mouse-absolute-pixel-position x y))
1479 ((eq frame-type 'w32) 1482 ((eq frame-type 'w32)