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
  • Loading branch information
Xottab-DUTY committed Jul 22, 2018
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
Expand Up @@ -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);
}
Expand All @@ -217,7 +221,6 @@ void FillVidModesToken(u32 monitorID)
if (!modes.empty())
FreeVidModesToken();


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

Expand Down

0 comments on commit 091d081

Please sign in to comment.