Skip to content

Commit

Permalink
Fixed bug with monitor selection when the system has monitors with th…
Browse files Browse the repository at this point in the history
…e same names
Xottab-DUTY committed Jul 22, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 10af65b commit 091d081
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/xrEngine/Device_create.cpp
Original file line number Diff line number Diff line change
@@ -204,7 +204,11 @@ void FillMonitorsToken()
monitors.reserve(displayCount + 1);

for (int i = 0; i < displayCount; ++i)
monitors.emplace_back(xr_strdup(SDL_GetDisplayName(i)), i);
{
string512 buf;
xr_sprintf(buf, sizeof(buf), "%d. %s", i + 1, SDL_GetDisplayName(i));
monitors.emplace_back(xr_strdup(buf), i);
}

monitors.emplace_back(nullptr, -1);
}
@@ -217,7 +221,6 @@ void FillVidModesToken(u32 monitorID)
if (!modes.empty())
FreeVidModesToken();


if (!rates.empty())
FreeRefreshRateToken();

0 comments on commit 091d081

Please sign in to comment.