fix custom resolution with high refresh rate monitors
This commit is contained in:
parent
0e2342860b
commit
1e9f3a0ab8
1 changed files with 4 additions and 1 deletions
5
src/dd.c
5
src/dd.c
|
@ -171,6 +171,8 @@ HRESULT dd_EnumDisplayModes(
|
||||||
m.dmSize = sizeof(DEVMODE);
|
m.dmSize = sizeof(DEVMODE);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
BOOL custom_res_injected = FALSE;
|
||||||
|
|
||||||
while (EnumDisplaySettings(NULL, i, &m))
|
while (EnumDisplaySettings(NULL, i, &m))
|
||||||
{
|
{
|
||||||
if (refresh_rate == m.dmDisplayFrequency &&
|
if (refresh_rate == m.dmDisplayFrequency &&
|
||||||
|
@ -183,10 +185,11 @@ HRESULT dd_EnumDisplayModes(
|
||||||
while (--m.dmPelsWidth % 8);
|
while (--m.dmPelsWidth % 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0 && g_config.custom_width && g_config.custom_height)
|
if (!custom_res_injected && g_config.custom_width && g_config.custom_height)
|
||||||
{
|
{
|
||||||
m.dmPelsWidth = g_config.custom_width;
|
m.dmPelsWidth = g_config.custom_width;
|
||||||
m.dmPelsHeight = g_config.custom_height;
|
m.dmPelsHeight = g_config.custom_height;
|
||||||
|
custom_res_injected = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE(
|
TRACE(
|
||||||
|
|
Loading…
Reference in a new issue