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 24, 2018
1 parent bc7cca0 commit a1dd12a
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 a1dd12a

Please sign in to comment.