mirror of https://github.com/mpv-player/mpv
mac/input: optimise mouse movement enabled check
This commit is contained in:
parent
53722a4082
commit
9a4c673dd7
|
@ -139,10 +139,11 @@ class InputHelper: NSObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setMouse(position pos: NSPoint) {
|
func setMouse(position: NSPoint) {
|
||||||
|
if !mouseEnabled() { return }
|
||||||
lock.withLock {
|
lock.withLock {
|
||||||
guard let input = input else { return }
|
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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,16 +132,12 @@ class View: NSView, CALayerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
override func mouseMoved(with event: NSEvent) {
|
override func mouseMoved(with event: NSEvent) {
|
||||||
if input?.mouseEnabled() ?? true {
|
signalMouseMovement(event)
|
||||||
signalMouseMovement(event)
|
|
||||||
}
|
|
||||||
common.titleBar?.show()
|
common.titleBar?.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func mouseDragged(with event: NSEvent) {
|
override func mouseDragged(with event: NSEvent) {
|
||||||
if input?.mouseEnabled() ?? true {
|
signalMouseMovement(event)
|
||||||
signalMouseMovement(event)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func mouseDown(with event: NSEvent) {
|
override func mouseDown(with event: NSEvent) {
|
||||||
|
|
Loading…
Reference in New Issue