xamarin-macios icon indicating copy to clipboard operation
xamarin-macios copied to clipboard

[feature request] CoreGraphics: implement CGDisplayMode / CGDisplayModeGetRefreshRate

Open janusw opened this issue 5 years ago • 1 comments

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.

janusw avatar Oct 25 '20 12:10 janusw

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

chamons avatar Oct 26 '20 20:10 chamons