mirror of https://github.com/mpv-player/mpv
cocoa-cb: implement hidpi scale reporting
This commit is contained in:
parent
8e9644761a
commit
d9e13f42b8
|
@ -474,6 +474,7 @@ class Window: NSWindow, NSWindowDelegate {
|
|||
|
||||
func windowDidChangeBackingProperties(_ notification: Notification) {
|
||||
cocoaCB.layer?.contentsScale = backingScaleFactor
|
||||
cocoaCB.flagEvents(VO_EVENT_WIN_STATE)
|
||||
}
|
||||
|
||||
func windowWillStartLiveResize(_ notification: Notification) {
|
||||
|
|
|
@ -485,6 +485,12 @@ class CocoaCB: NSObject {
|
|||
return VO_TRUE
|
||||
}
|
||||
return VO_FALSE
|
||||
case VOCTRL_GET_HIDPI_SCALE:
|
||||
if let scaleFactor = data?.assumingMemoryBound(to: CDouble.self) {
|
||||
scaleFactor.pointee = Double(ccb.window?.backingScaleFactor ?? 1.0)
|
||||
return VO_TRUE;
|
||||
}
|
||||
return VO_FALSE
|
||||
case VOCTRL_RESTORE_SCREENSAVER:
|
||||
ccb.enableDisplaySleep()
|
||||
return VO_TRUE
|
||||
|
|
Loading…
Reference in New Issue