| 122 | } |
| 123 | |
| 124 | std::optional<float> WindowInfo::QueryRefreshRateForWindow(const WindowInfo& wi) |
| 125 | { |
| 126 | std::optional<float> ret; |
| 127 | if (wi.type != Type::Win32 || !wi.window_handle) |
| 128 | return ret; |
| 129 | |
| 130 | // Try DWM first, then fall back to integer values. |
| 131 | const HWND hwnd = static_cast<HWND>(wi.window_handle); |
| 132 | ret = GetRefreshRateFromDisplayConfig(hwnd); |
| 133 | if (!ret.has_value()) |
| 134 | { |
| 135 | ret = GetRefreshRateFromDWM(hwnd); |
| 136 | if (!ret.has_value()) |
| 137 | ret = GetRefreshRateFromMonitor(hwnd); |
| 138 | } |
| 139 | |
| 140 | return ret; |
| 141 | } |
| 142 | |
| 143 | #elif defined(__APPLE__) |
| 144 |
nothing calls this directly
no test coverage detected