summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2024-03-14 00:36:05 +0100
committerder richter <der.richter@gmx.de>2024-03-16 15:29:27 +0100
commit9a4c673dd7994e46cc7f3768d05519c1411af8ba (patch)
tree3408928ecc8b0ac00113f610c691ca5b1f959a3f /osdep
parent53722a408254cb99fc7bcc7c729cc0c5044c2ebb (diff)
downloadmpv-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.swift5
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))
}
}