xamarin-macios
xamarin-macios copied to clipboard
[feature request] CoreGraphics: implement CGDisplayMode / CGDisplayModeGetRefreshRate
It seems that CoreGraphics support is incomplete in Xamarin.Mac. Searching for CGDisplayModeGetRefreshRate in the github repo only gives me one hit:
https://github.com/xamarin/xamarin-macios/blob/main/tests/xtro-sharpie/macOS-CoreGraphics.ignore: !missing-pinvoke! CGDisplayModeGetRefreshRate is not bound
Background: I want to determine the screen refresh rate on MacOS via the Xamarin APIs. CoreGraphics has a function to accomplish that: CGDisplayModeGetRefreshRate. In Swift this is part of the class CGDisplayMode.
I looked at implementing this, but as Xamarin.Mac is currently disabled in Main until Xcode 12.2 land (due to last minute removal of bound APIs by Apple) it isn't a good time to land it.
Here my untested diff:
https://git.io/JT6EB