diff --git a/DisplayMagician/Properties/AssemblyInfo.cs b/DisplayMagician/Properties/AssemblyInfo.cs index be7313b..b0636b5 100644 --- a/DisplayMagician/Properties/AssemblyInfo.cs +++ b/DisplayMagician/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ using System.Resources; [assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")] // Version information -[assembly: AssemblyVersion("2.1.1.42")] -[assembly: AssemblyFileVersion("2.1.1.42")] +[assembly: AssemblyVersion("2.1.1.48")] +[assembly: AssemblyFileVersion("2.1.1.48")] [assembly: NeutralResourcesLanguageAttribute( "en" )] [assembly: CLSCompliant(true)] diff --git a/DisplayMagicianShared/ProfileItem.cs b/DisplayMagicianShared/ProfileItem.cs index 53abb03..2271031 100644 --- a/DisplayMagicianShared/ProfileItem.cs +++ b/DisplayMagicianShared/ProfileItem.cs @@ -23,6 +23,7 @@ namespace DisplayMagicianShared public int ScreenWidth; public int ScreenHeight; public string Name; + public string AdapterName; public string Library; public bool IsPrimary; public bool IsClone; @@ -997,17 +998,20 @@ namespace DisplayMagicianShared // For each path we go through and get the relevant info we need. if (_windowsDisplayConfig.DisplayConfigPaths.Length > 0) { - // Set some basics about the screen - ScreenPosition screen = new ScreenPosition(); - screen.Library = "NVIDIA"; - screen.IsSpanned = false; - screen.Colour = normalScreenColor; // this is the default unless overridden by the primary screen + UInt64 adapterId = path.SourceInfo.AdapterId.Value; UInt32 sourceId = path.SourceInfo.Id; UInt32 targetId = path.TargetInfo.Id; + // Set some basics about the screen + ScreenPosition screen = new ScreenPosition(); + screen.Library = "NVIDIA"; + //screen.AdapterName = adapterId.ToString(); + screen.IsSpanned = false; + screen.Colour = normalScreenColor; // this is the default unless overridden by the primary screen screen.IsClone = false; screen.ClonedCopies = 0; + //screen.DisplayConnector = path.TargetInfo.OutputTechnology.ToString("G"); foreach (var displaySource in _windowsDisplayConfig.DisplaySources) { if (displaySource.Value.Contains(sourceId)) @@ -1027,7 +1031,7 @@ namespace DisplayMagicianShared foreach (DISPLAYCONFIG_MODE_INFO displayMode in _windowsDisplayConfig.DisplayConfigModes) { // Find the matching Display Config Source Mode - if (displayMode.InfoType == DISPLAYCONFIG_MODE_INFO_TYPE.DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE && displayMode.Id == sourceId) + if (displayMode.InfoType == DISPLAYCONFIG_MODE_INFO_TYPE.DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE && displayMode.Id == sourceId && displayMode.AdapterId.Value == adapterId) { screen.Name = targetId.ToString(); //screen.DisplayConnector = displayMode.DisplayConnector; @@ -1254,17 +1258,19 @@ namespace DisplayMagicianShared // For each path we go through and get the relevant info we need. if (_windowsDisplayConfig.DisplayConfigPaths.Length > 0) { - // Set some basics about the screen - ScreenPosition screen = new ScreenPosition(); - screen.Library = "AMD"; - screen.IsSpanned = false; - screen.Colour = normalScreenColor; // this is the default unless overridden by the primary screen - + UInt64 adapterId = path.SourceInfo.AdapterId.Value; UInt32 sourceId = path.SourceInfo.Id; UInt32 targetId = path.TargetInfo.Id; + // Set some basics about the screen + ScreenPosition screen = new ScreenPosition(); + screen.Library = "AMD"; + //screen.AdapterName = adapterId.ToString(); + screen.IsSpanned = false; + screen.Colour = normalScreenColor; // this is the default unless overridden by the primary screen screen.IsClone = false; screen.ClonedCopies = 0; + //screen.DisplayConnector = path.TargetInfo.OutputTechnology.ToString("G"); foreach (var displaySource in _windowsDisplayConfig.DisplaySources) { if (displaySource.Value.Contains(sourceId)) @@ -1283,7 +1289,7 @@ namespace DisplayMagicianShared foreach (DISPLAYCONFIG_MODE_INFO displayMode in _windowsDisplayConfig.DisplayConfigModes) { // Find the matching Display Config Source Mode - if (displayMode.InfoType == DISPLAYCONFIG_MODE_INFO_TYPE.DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE && displayMode.Id == sourceId) + if (displayMode.InfoType == DISPLAYCONFIG_MODE_INFO_TYPE.DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE && displayMode.Id == sourceId && displayMode.AdapterId.Value == adapterId) { screen.Name = targetId.ToString(); //screen.DisplayConnector = displayMode.DisplayConnector; @@ -1369,17 +1375,19 @@ namespace DisplayMagicianShared // For each path we go through and get the relevant info we need. if (_windowsDisplayConfig.DisplayConfigPaths.Length > 0) { - // Set some basics about the screen - ScreenPosition screen = new ScreenPosition(); - screen.Library = "WINDOWS"; - screen.IsSpanned = false; - screen.Colour = normalScreenColor; // this is the default unless overridden by the primary screen - + UInt64 adapterId = path.SourceInfo.AdapterId.Value; UInt32 sourceId = path.SourceInfo.Id; UInt32 targetId = path.TargetInfo.Id; + // Set some basics about the screen + ScreenPosition screen = new ScreenPosition(); + screen.Library = "WINDOWS"; + //screen.AdapterName = adapterId.ToString(); + screen.IsSpanned = false; + screen.Colour = normalScreenColor; // this is the default unless overridden by the primary screen screen.IsClone = false; screen.ClonedCopies = 0; + //screen.DisplayConnector = path.TargetInfo.OutputTechnology.ToString("G"); foreach (var displaySource in _windowsDisplayConfig.DisplaySources) { if (displaySource.Value.Contains(sourceId)) @@ -1398,7 +1406,7 @@ namespace DisplayMagicianShared foreach (DISPLAYCONFIG_MODE_INFO displayMode in _windowsDisplayConfig.DisplayConfigModes) { // Find the matching Display Config Source Mode - if (displayMode.InfoType == DISPLAYCONFIG_MODE_INFO_TYPE.DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE && displayMode.Id == sourceId) + if (displayMode.InfoType == DISPLAYCONFIG_MODE_INFO_TYPE.DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE && displayMode.Id == sourceId && displayMode.AdapterId.Value == adapterId) { screen.Name = targetId.ToString(); //screen.DisplayConnector = displayMode.DisplayConnector; diff --git a/DisplayMagicianShared/UserControls/DisplayView.cs b/DisplayMagicianShared/UserControls/DisplayView.cs index 67e423f..654bdda 100644 --- a/DisplayMagicianShared/UserControls/DisplayView.cs +++ b/DisplayMagicianShared/UserControls/DisplayView.cs @@ -203,15 +203,21 @@ namespace DisplayMagicianShared.UserControls Rectangle wordRect = new Rectangle(screen.ScreenX + screenBezel + screenWordBuffer, screen.ScreenY + screenBezel + screenWordBuffer, screen.ScreenWidth - (screenBezel * 2) - (screenWordBuffer * 2), screen.ScreenHeight - (screenBezel * 2) - (screenWordBuffer * 2)); Color wordTextColour = pickTextColorBasedOnBgColour(screen.Colour, lightTextColour, darkTextColour); // Draw the name of the screen and the size of it - string str = $"{screen.Name}{Environment.NewLine}{screen.ScreenWidth}×{screen.ScreenHeight}{Environment.NewLine}{screen.DisplayConnector}"; + string str = $"{screen.Name}{Environment.NewLine}"; + str += $"{screen.ScreenWidth}×{ screen.ScreenHeight}{ Environment.NewLine}{ screen.DisplayConnector}"; if (screen.IsPrimary) { str = $"Primary Display{Environment.NewLine}" + str; } if (screen.IsClone) { - str = str + $"(+{screen.ClonedCopies-1} Clone)"; + str += $"(+{screen.ClonedCopies-1} Clone)"; } + if (!String.IsNullOrEmpty(screen.AdapterName)) + { + str += $"Adapter {screen.AdapterName}{Environment.NewLine}"; + } + DrawString(g, str, wordTextColour, selectedWordFont, wordRect.Size, wordRect.Location);