[3.x] Make OSIPhone::get_screen_refresh_rate respect iOS Low Power Mode

This commit is contained in:
Zach Coleman 2023-11-22 11:56:12 -05:00
parent e96c42f0e1
commit f330bea7a0

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 {
return [UIScreen mainScreen].maximumFramesPerSecond;
float fps = [UIScreen mainScreen].maximumFramesPerSecond;
if ([NSProcessInfo processInfo].lowPowerModeEnabled) {
fps = 60;
}
return fps;
}
Rect2 OSIPhone::get_window_safe_area() const {