mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-12 00:14:20 +00:00
Do not use the manifest setting as it prevents setting DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
The manifest has dpiAware set to True/PM (PerMonitor) and won't allow a change to PerMonitorV2 afterwards. https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process
This commit is contained in:
parent
10fca0e8b1
commit
4e88d1d589
2 changed files with 9 additions and 5 deletions
|
|
@ -100,7 +100,8 @@
|
|||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>
|
||||
</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
|
@ -117,7 +118,8 @@
|
|||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>
|
||||
</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
|
@ -139,7 +141,8 @@
|
|||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>
|
||||
</EnableDpiAwareness>
|
||||
<OutputManifestFile>
|
||||
</OutputManifestFile>
|
||||
</Manifest>
|
||||
|
|
@ -167,7 +170,8 @@
|
|||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>
|
||||
</EnableDpiAwareness>
|
||||
<OutputManifestFile>
|
||||
</OutputManifestFile>
|
||||
</Manifest>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
{
|
||||
// Make process DPI aware and obtain main monitor scale
|
||||
// https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process
|
||||
// ImGui_ImplWin32_EnableDpiAwareness(); // This is already set in the manifest so the call will fail, but leaving it for completeness.
|
||||
ImGui_ImplWin32_EnableDpiAwareness();
|
||||
float main_scale = ImGui_ImplWin32_GetDpiScaleForMonitor(::MonitorFromPoint(POINT{ 0, 0 }, MONITOR_DEFAULTTOPRIMARY));
|
||||
|
||||
// Create application window
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue