Added patch to convert v2.0.1 displaySource to list

This should help avoid a crash to desktop when using cloned displays. Partially fixes #47
This commit is contained in:
Terry MacDonald
2021-10-16 16:45:49 +13:00
parent d98372bf39
commit cf1ff873ef
5 changed files with 63 additions and 27 deletions

View File

@ -973,7 +973,7 @@ namespace DisplayMagicianShared
{
uint displayId = _nvidiaDisplayConfig.MosaicConfig.MosaicGridTopos[i].Displays[0].DisplayId;
string windowsDisplayName = _nvidiaDisplayConfig.DisplayNames[displayId];
uint sourceIndex = _windowsDisplayConfig.DisplaySources[windowsDisplayName];
List<uint> sourceIndexes = _windowsDisplayConfig.DisplaySources[windowsDisplayName];
for (int x = 0; x < _windowsDisplayConfig.DisplayConfigModes.Length; x++)
{
// Skip this if its not a source info config type
@ -982,8 +982,8 @@ namespace DisplayMagicianShared
continue;
}
// If the source index matches the index of the source info object we're looking at, then process it!
if (_windowsDisplayConfig.DisplayConfigModes[x].Id == sourceIndex)
// If the source index matches the index of the source info object we're looking at, then process it!
if (sourceIndexes.Contains(_windowsDisplayConfig.DisplayConfigModes[x].Id))
{
screen.Name = displayId.ToString();