aboutsummaryrefslogtreecommitdiffstats
path: root/test
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 /test
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 'test')
-rw-r--r--test/lisp/mouse-tests.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/lisp/mouse-tests.el b/test/lisp/mouse-tests.el
index fffaa2fa53d..a8eca28365e 100644
--- a/test/lisp/mouse-tests.el
+++ b/test/lisp/mouse-tests.el
@@ -47,4 +47,13 @@ translate ‘mouse-1’ events into ‘mouse-2’ events."
47 (should-not (mouse--down-1-maybe-follows-link)) 47 (should-not (mouse--down-1-maybe-follows-link))
48 (should (equal unread-command-events '((mouse-2 nil 1)))))) 48 (should (equal unread-command-events '((mouse-2 nil 1))))))
49 49
50(ert-deftest bug26816-mouse-frame-movement ()
51 "Mouse moves relative to frame."
52 (skip-unless (display-graphic-p))
53 (let ((frame (selected-frame)))
54 (set-mouse-position frame 0 0)
55 (should (equal (mouse-position)
56 (cons frame (cons 0 0))))))
57
58
50;;; mouse-tests.el ends here 59;;; mouse-tests.el ends here