ACPI modes support for Vivobook https://github.com/seerge/g-helper/issues/1089
This commit is contained in:
Serge
2023-08-15 13:59:07 +02:00
parent bd7985e817
commit a985cc5bbb
4 changed files with 27 additions and 4 deletions

View File

@@ -1,8 +1,19 @@
using System.Runtime.InteropServices;
using System.Collections;
using System.Runtime.InteropServices;
using static GHelper.Display.ScreenInterrogatory;
namespace GHelper.Display
{
class ScreenComparer : IComparer
{
public int Compare(object x, object y)
{
int displayX = Int32.Parse(((Screen)x).DeviceName.Replace(@"\\.\DISPLAY", ""));
int displayY = Int32.Parse(((Screen)y).DeviceName.Replace(@"\\.\DISPLAY", ""));
return (new CaseInsensitiveComparer()).Compare(displayX, displayY);
}
}
internal class ScreenNative
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
@@ -166,6 +177,8 @@ namespace GHelper.Display
count++;
}
Array.Sort(screens, new ScreenComparer());
count = 0;
foreach (var screen in screens)
{