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 {
|
||||
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,17 +132,13 @@ class View: NSView, CALayerDelegate {
|
|||
}
|
||||
|
||||
override func mouseMoved(with event: NSEvent) {
|
||||
if input?.mouseEnabled() ?? true {
|
||||
signalMouseMovement(event)
|
||||
}
|
||||
common.titleBar?.show()
|
||||
}
|
||||
|
||||
override func mouseDragged(with event: NSEvent) {
|
||||
if input?.mouseEnabled() ?? true {
|
||||
signalMouseMovement(event)
|
||||
}
|
||||
}
|
||||
|
||||
override func mouseDown(with event: NSEvent) {
|
||||
hasMouseDown = true
|
||||
|
|
Loading…
Reference in New Issue