Merge pull request #85230 from ztc0611/3.x-fix-ios-get-refreshrate

[3.x] [iOS] Make `OSIPhone::get_screen_refresh_rate` respect iOS Low Power Mode
This commit is contained in:
Rémi Verschelde 2023-12-08 15:42:29 +01:00
commit 7d14dbf11f
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -653,7 +653,11 @@ int OSIPhone::get_screen_dpi(int p_screen) const {
} }
float OSIPhone::get_screen_refresh_rate(int p_screen) const { float OSIPhone::get_screen_refresh_rate(int p_screen) const {
return [UIScreen mainScreen].maximumFramesPerSecond; float fps = [UIScreen mainScreen].maximumFramesPerSecond;
if ([NSProcessInfo processInfo].lowPowerModeEnabled) {
fps = 60;
}
return fps;
} }
Rect2 OSIPhone::get_window_safe_area() const { Rect2 OSIPhone::get_window_safe_area() const {