Skip to content

Commit a1dd12a

Browse files
committed
Fixed bug with monitor selection when the system has monitors with the same names
1 parent bc7cca0 commit a1dd12a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/xrEngine/Device_create.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ void FillMonitorsToken()
204204
monitors.reserve(displayCount + 1);
205205

206206
for (int i = 0; i < displayCount; ++i)
207-
monitors.emplace_back(xr_strdup(SDL_GetDisplayName(i)), i);
207+
{
208+
string512 buf;
209+
xr_sprintf(buf, sizeof(buf), "%d. %s", i + 1, SDL_GetDisplayName(i));
210+
monitors.emplace_back(xr_strdup(buf), i);
211+
}
208212

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

220-
221224
if (!rates.empty())
222225
FreeRefreshRateToken();
223226

0 commit comments

Comments
 (0)