Merge pull request #85026 from ztc0611/fix-ios-getrefreshrate

Make screen_get_refresh_rate() respect iOS Low Power Mode
This commit is contained in:
Yuri Sizov 2023-12-08 16:58:19 +01:00
commit abddb93152

View file

@ -443,7 +443,11 @@ int DisplayServerIOS::screen_get_dpi(int p_screen) const {
}
float DisplayServerIOS::screen_get_refresh_rate(int p_screen) const {
return [UIScreen mainScreen].maximumFramesPerSecond;
float fps = [UIScreen mainScreen].maximumFramesPerSecond;
if ([NSProcessInfo processInfo].lowPowerModeEnabled) {
fps = 60;
}
return fps;
}
float DisplayServerIOS::screen_get_scale(int p_screen) const {