mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 16:54:14 +01:00
[util] Don't set display mode if the desired mode is already set
See #1489. Co-authored-by: zvova7890 <zvova7890@gmail.com>
This commit is contained in:
parent
5e41e00456
commit
3a1243b05e
@ -25,6 +25,21 @@ namespace dxvk {
|
|||||||
pMode->dmPelsWidth, "x", pMode->dmPelsHeight, "@",
|
pMode->dmPelsWidth, "x", pMode->dmPelsHeight, "@",
|
||||||
pMode->dmDisplayFrequency));
|
pMode->dmDisplayFrequency));
|
||||||
|
|
||||||
|
DEVMODEW curMode = { };
|
||||||
|
curMode.dmSize = sizeof(curMode);
|
||||||
|
|
||||||
|
if (GetMonitorDisplayMode(hMonitor, ENUM_CURRENT_SETTINGS, &curMode)) {
|
||||||
|
bool eq = curMode.dmPelsWidth == pMode->dmPelsWidth
|
||||||
|
&& curMode.dmPelsHeight == pMode->dmPelsHeight
|
||||||
|
&& curMode.dmBitsPerPel == pMode->dmBitsPerPel;
|
||||||
|
|
||||||
|
if (pMode->dmFields & DM_DISPLAYFREQUENCY)
|
||||||
|
eq &= curMode.dmDisplayFrequency == pMode->dmDisplayFrequency;
|
||||||
|
|
||||||
|
if (eq)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LONG status = ::ChangeDisplaySettingsExW(monInfo.szDevice,
|
LONG status = ::ChangeDisplaySettingsExW(monInfo.szDevice,
|
||||||
pMode, nullptr, CDS_FULLSCREEN, nullptr);
|
pMode, nullptr, CDS_FULLSCREEN, nullptr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user