Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
[d3d9] Re-try setting display mode without frequency if it fails
Browse files Browse the repository at this point in the history
Fixes #405
  • Loading branch information
misyltoad committed Oct 16, 2019
1 parent 0e641b4 commit 059b8fe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/d3d9/d3d9_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ namespace dxvk {

LONG status = ::ChangeDisplaySettingsExW(
monInfo.szDevice, &devMode, nullptr, CDS_FULLSCREEN, nullptr);

if (status != DISP_CHANGE_SUCCESSFUL) {
// Try again but without setting the frequency.
devMode.dmFields &= ~DM_DISPLAYFREQUENCY;
devMode.dmDisplayFrequency = 0;
status = ::ChangeDisplaySettingsExW(
monInfo.szDevice, &devMode, nullptr, CDS_FULLSCREEN, nullptr);
}

return status == DISP_CHANGE_SUCCESSFUL ? D3D_OK : D3DERR_NOTAVAILABLE;
}
Expand Down

0 comments on commit 059b8fe

Please sign in to comment.