cocoa-cb: implement hidpi scale reporting

This commit is contained in:
der richter 2019-12-24 18:28:46 +01:00
parent 8e9644761a
commit d9e13f42b8
2 changed files with 7 additions and 0 deletions

View File

@ -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) {

View File

@ -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