diff options
author | der richter <der.richter@gmx.de> | 2024-03-14 00:36:05 +0100 |
---|---|---|
committer | der richter <der.richter@gmx.de> | 2024-03-16 15:29:27 +0100 |
commit | 9a4c673dd7994e46cc7f3768d05519c1411af8ba (patch) | |
tree | 3408928ecc8b0ac00113f610c691ca5b1f959a3f /osdep | |
parent | 53722a408254cb99fc7bcc7c729cc0c5044c2ebb (diff) | |
download | mpv-9a4c673dd7994e46cc7f3768d05519c1411af8ba.tar.bz2 mpv-9a4c673dd7994e46cc7f3768d05519c1411af8ba.tar.xz |
mac/input: optimise mouse movement enabled check
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/mac/input_helper.swift | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/osdep/mac/input_helper.swift b/osdep/mac/input_helper.swift index 7b954db2ba..c9891b7a7e 100644 --- a/osdep/mac/input_helper.swift +++ b/osdep/mac/input_helper.swift @@ -139,10 +139,11 @@ class InputHelper: NSObject { } } - func setMouse(position pos: NSPoint) { + func setMouse(position: NSPoint) { + if !mouseEnabled() { return } lock.withLock { guard let input = input else { return } - mp_input_set_mouse_pos(input, Int32(pos.x), Int32(pos.y)) + mp_input_set_mouse_pos(input, Int32(position.x), Int32(position.y)) } } |