버그 수정

This commit is contained in:
2026-05-11 17:27:04 +09:00
parent 73aebe2d8c
commit fcdae4947e
99 changed files with 5478 additions and 15 deletions

View File

@@ -0,0 +1,17 @@
using System;
using System.Runtime.InteropServices;
namespace FullscreenEditor.Windows {
internal static class GDI32 {
// http://pinvoke.net/default.aspx/gdi32/GetDeviceCaps.html
public enum DeviceCap {
VERTRES = 10,
DESKTOPVERTRES = 117,
}
[DllImport("gdi32.dll")]
public static extern int GetDeviceCaps(IntPtr hDc, int nIndex);
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: d2e63aa031b326e4c932e1015ea72da1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 69534
packageName: Fullscreen Editor
packageVersion: 2.2.10
assetPath: Packages/com.mibdev.fullscreen-editor/Editor/Windows/GDI32.cs
uploadId: 803440

View File

@@ -0,0 +1,18 @@
using System;
using System.Runtime.InteropServices;
namespace FullscreenEditor.Windows {
internal enum MonitorDpiType {
MDT_EFFECTIVE_DPI = 0,
MDT_ANGULAR_DPI = 1,
MDT_RAW_DPI = 2,
}
internal static class ShCore {
[DllImport("shcore.dll")]
internal static extern uint GetDpiForMonitor(IntPtr hmonitor, MonitorDpiType dpiType, out uint dpiX, out uint dpiY);
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 452ce41cefb917e42b0f681115e84f84
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 69534
packageName: Fullscreen Editor
packageVersion: 2.2.10
assetPath: Packages/com.mibdev.fullscreen-editor/Editor/Windows/ShCore.cs
uploadId: 803440

View File

@@ -0,0 +1,127 @@
using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace FullscreenEditor.Windows {
[System.Serializable]
[StructLayout(LayoutKind.Sequential)]
internal struct NativeRect {
public int left;
public int top;
public int right;
public int bottom;
public static implicit operator Rect(NativeRect other) {
return Rect.MinMaxRect(
other.left,
other.top,
other.right,
other.bottom
);
}
public static implicit operator NativeRect(Rect other) {
return new NativeRect {
left = (int)other.xMin,
top = (int)other.yMin,
right = (int)other.xMax,
bottom = (int)other.yMax
};
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
internal struct MonitorInfoEx {
private const int CCHDEVICENAME = 0x20;
public int size;
public NativeRect monitor;
public NativeRect work;
public uint flags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHDEVICENAME)]
public string DeviceName;
public void Init() {
this.size = 40 + 1 * CCHDEVICENAME;
this.DeviceName = string.Empty;
}
}
[System.Serializable]
[StructLayout(LayoutKind.Sequential)]
internal struct DevMode {
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
public string dmDeviceName;
public short dmSpecVersion;
public short dmDriverVersion;
public short dmSize;
public short dmDriverExtra;
public int dmFields;
public int dmPositionX;
public int dmPositionY;
public ScreenOrientation dmDisplayOrientation;
public int dmDisplayFixedOutput;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
public string dmFormName;
public short dmLogPixels;
public int dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmICMMethod;
public int dmICMIntent;
public int dmMediaType;
public int dmDitherType;
public int dmReserved1;
public int dmReserved2;
public int dmPanningWidth;
public int dmPanningHeight;
}
[Flags]
internal enum DisplayDeviceStateFlags : int {
/// <summary>The device is part of the desktop.</summary>
AttachedToDesktop = 0x1,
MultiDriver = 0x2,
/// <summary>The device is part of the desktop.</summary>
PrimaryDevice = 0x4,
/// <summary>Represents a pseudo device used to mirror application drawing for remoting or other purposes.</summary>
MirroringDriver = 0x8,
/// <summary>The device is VGA compatible.</summary>
VGACompatible = 0x10,
/// <summary>The device is removable; it cannot be the primary display.</summary>
Removable = 0x20,
/// <summary>The device has more display modes than its output devices support.</summary>
ModesPruned = 0x8000000,
Remote = 0x4000000,
Disconnect = 0x2000000
}
[System.Serializable]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
internal struct DisplayDevice {
[MarshalAs(UnmanagedType.U4)]
public int cb;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string DeviceName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string DeviceString;
[MarshalAs(UnmanagedType.U4)]
public DisplayDeviceStateFlags StateFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string DeviceID;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string DeviceKey;
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: dd1767e9696fe0a4ca0d7d06b1384272
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 69534
packageName: Fullscreen Editor
packageVersion: 2.2.10
assetPath: Packages/com.mibdev.fullscreen-editor/Editor/Windows/Structs.cs
uploadId: 803440

View File

@@ -0,0 +1,32 @@
using System;
using System.Runtime.InteropServices;
namespace FullscreenEditor.Windows {
internal static class User32 {
public delegate bool EnumMonitorsDelegate(IntPtr hMonitor, IntPtr hdcMonitor, ref NativeRect lprcMonitor, IntPtr dwData);
[DllImport("user32.dll")]
public static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr lprcClip, EnumMonitorsDelegate lpfnEnum, IntPtr dwData);
[DllImport("user32.dll")]
public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MonitorInfoEx lpmi);
[DllImport("user32.dll")]
public static extern bool EnumDisplaySettings(string deviceName, int modeNum, ref DevMode devMode);
[DllImport("user32.dll")]
public static extern bool EnumDisplayDevices(string lpDevice, uint iDevNum, ref DisplayDevice lpDisplayDevice, uint dwFlags);
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDc);
[DllImport("user32.dll", SetLastError = true)]
public static extern int GetSystemMetrics(int smIndex);
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 2d1661fb151eb4d48a4dc4e4294a3351
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 69534
packageName: Fullscreen Editor
packageVersion: 2.2.10
assetPath: Packages/com.mibdev.fullscreen-editor/Editor/Windows/User32.cs
uploadId: 803440