You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (monitor_info->x != monitors[p_screen].x || monitor_info->y != monitors[p_screen].y) { // If X and Y aren't the same as the monitor we're looking for, this isn't the right monitor. Continue.
for (int mode = 0; mode < screen_res->nmode; mode++) {
1835
+
if (screen_res->modes[mode].id == monitor_info->mode) {
1836
+
mode_info = &screen_res->modes[mode];
1845
1837
}
1846
-
1847
-
ERR_PRINT("An error occurred while trying to get the screen refresh rate."); // We should have returned the refresh rate by now. An error must have occurred.
1848
-
return SCREEN_REFRESH_RATE_FALLBACK;
1849
-
} else {
1850
-
ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
1851
-
return SCREEN_REFRESH_RATE_FALLBACK;
1852
1838
}
1839
+
XRRFreeCrtcInfo(monitor_info);
1840
+
break;
1841
+
}
1842
+
1843
+
float result;
1844
+
if (mode_info) {
1845
+
// Snap to nearest 0.01 to stay consistent with other platforms.
1846
+
result = Math::snapped((float)mode_info->dotClock / ((float)mode_info->hTotal * (float)mode_info->vTotal), 0.01);
1847
+
} else {
1848
+
ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
1849
+
result = SCREEN_REFRESH_RATE_FALLBACK;
1853
1850
}
1854
-
ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
0 commit comments