mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Updated screen drawing so surround displays work with additional screens
The display logic now works when both NVIDIA surround and normal windows are both being used at the same time.
This commit is contained in:
parent
0b759ce378
commit
3ea0ff479b
@ -26,8 +26,8 @@ using System.Resources;
|
|||||||
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
[assembly: AssemblyVersion("2.1.0.30")]
|
[assembly: AssemblyVersion("2.1.0.33")]
|
||||||
[assembly: AssemblyFileVersion("2.1.0.30")]
|
[assembly: AssemblyFileVersion("2.1.0.33")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
||||||
|
|
||||||
|
@ -822,9 +822,6 @@ namespace DisplayMagicianShared
|
|||||||
// Now we need to check for Spanned screens
|
// Now we need to check for Spanned screens
|
||||||
if (_nvidiaDisplayConfig.MosaicConfig.IsMosaicEnabled)
|
if (_nvidiaDisplayConfig.MosaicConfig.IsMosaicEnabled)
|
||||||
{
|
{
|
||||||
// TODO: Make the NVIDIA displays show the individual screens and overlap!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Create a dictionary of all the screen sizes we want
|
// Create a dictionary of all the screen sizes we want
|
||||||
//Dictionary<string,SpannedScreenPosition> MosaicScreens = new Dictionary<string,SpannedScreenPosition>();
|
//Dictionary<string,SpannedScreenPosition> MosaicScreens = new Dictionary<string,SpannedScreenPosition>();
|
||||||
@ -904,12 +901,54 @@ namespace DisplayMagicianShared
|
|||||||
screen.SpannedScreens.Add(spannedScreen);
|
screen.SpannedScreens.Add(spannedScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Need to look for the Windows layout details now we know the size of this display
|
||||||
|
// Set some basics about the screen
|
||||||
|
try
|
||||||
|
{
|
||||||
|
uint displayId = _nvidiaDisplayConfig.MosaicConfig.MosaicGridTopos[i].Displays[0].DisplayId;
|
||||||
|
string windowsDisplayName = _nvidiaDisplayConfig.DisplayNames[displayId];
|
||||||
|
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
|
||||||
|
if (_windowsDisplayConfig.DisplayConfigModes[x].InfoType != DISPLAYCONFIG_MODE_INFO_TYPE.DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
|
||||||
|
screen.ScreenX = (int)_windowsDisplayConfig.DisplayConfigModes[x].SourceMode.Position.X;
|
||||||
|
screen.ScreenY = (int)_windowsDisplayConfig.DisplayConfigModes[x].SourceMode.Position.Y;
|
||||||
|
screen.ScreenWidth = (int)_windowsDisplayConfig.DisplayConfigModes[x].SourceMode.Width;
|
||||||
|
screen.ScreenHeight = (int)_windowsDisplayConfig.DisplayConfigModes[x].SourceMode.Height;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (KeyNotFoundException ex)
|
||||||
|
{
|
||||||
|
// Thrown if the Windows display doesn't match the NVIDIA display.
|
||||||
|
// Typically happens during configuration of a new Mosaic mode.
|
||||||
|
// If we hit this issue, then we just want to skip over it, as we can update it later when the user pushes the button.
|
||||||
|
// This only happens due to the auto detection stuff functionality we have built in to try and update as quickly as we can.
|
||||||
|
// So its something that we can safely ignore if we hit this exception as it is part of the expect behaviour
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Some other exception has occurred and we need to report it.
|
||||||
//screen.Name = targetId.ToString();
|
//screen.Name = targetId.ToString();
|
||||||
//screen.DisplayConnector = displayMode.DisplayConnector;
|
//screen.DisplayConnector = displayMode.DisplayConnector;
|
||||||
screen.ScreenX = (int)overallX;
|
screen.ScreenX = (int)overallX;
|
||||||
screen.ScreenY = (int)overallY;
|
screen.ScreenY = (int)overallY;
|
||||||
screen.ScreenWidth = (int)overallWidth;
|
screen.ScreenWidth = (int)overallWidth;
|
||||||
screen.ScreenHeight = (int)overallHeight;
|
screen.ScreenHeight = (int)overallHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// If we're at the 0,0 coordinate then we're the primary monitor
|
// If we're at the 0,0 coordinate then we're the primary monitor
|
||||||
if (screen.ScreenX == 0 && screen.ScreenY == 0)
|
if (screen.ScreenX == 0 && screen.ScreenY == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user