0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00

cocoa-cb: don't deactivate mouse events completely with input-cursor=no

mouse events and the tracking area are needed for (un)hiding the new
title bar, which was broken when input-cursor=no was set. no tracking
area was ever created and set which completely deactivated any mouse
events. the specific mouse event functions were already deactivated
proactively and have the needed check. no events are being propagated to
the mpv core when input-cursor=no is set, even with an active tracking
area.
This commit is contained in:
Akemi 2018-03-08 21:24:07 +01:00 committed by Kevin Mitchell
parent b0da883b13
commit 4485e205b9

View File

@ -48,10 +48,6 @@ class EventsView: NSView {
removeTrackingArea(tracker!)
}
if mpv != nil && !mpv.getBoolProperty("input-cursor") {
return
}
tracker = NSTrackingArea(rect: bounds,
options: [.activeAlways, .mouseEnteredAndExited, .mouseMoved, .enabledDuringMouseDrag],
owner: self, userInfo: nil)
@ -88,12 +84,11 @@ class EventsView: NSView {
}
override func acceptsFirstMouse(for event: NSEvent?) -> Bool {
return mpv.getBoolProperty("input-cursor")
return true
}
override func becomeFirstResponder() -> Bool {
return mpv.getBoolProperty("input-cursor") ||
mpv.getBoolProperty("input-vo-keyboard")
return true
}
override func resignFirstResponder() -> Bool {