mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
8c20514b8d
On a system with 2 or more displays with different DPI settings, moving the PuTTY window from one display to another will make Windows resize the window using its "bitmap" strategy, stretching/compressing the text, making it fuzzy and harder to read. This change makes PuTTY resize its window and font size to accurately fit the DPI of the display it is on. We process the WM_DPICHANGED message, saving the new DPI, window size and position. We proceed to then reset the window, recreating the fonts using the new DPI and calculate the new window size and position based on the new font size, user display options (ie. with/without scrollbar) and the suggested window position provided by Windows. The suggested window size is usually not a perfect fit, therefore we must add a small offset to the new window position in order to avoid issues with repeated DPI changes while dragging the window from one display to another.
36 lines
1.3 KiB
XML
36 lines
1.3 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<!-- Do not attempt to do anything clever with this file, as some versions of
|
|
Windows are very sensitive to the exact format.
|
|
Hence, some facts below are fibs. -->
|
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
|
<assemblyIdentity
|
|
version="0.0.0.0"
|
|
processorArchitecture="*"
|
|
name="PuTTYtel"
|
|
type="win32" />
|
|
<description>A network client and terminal emulator</description>
|
|
<dependency>
|
|
<dependentAssembly>
|
|
<!-- Load Common Controls 6 instead of 5 to get WinXP native-
|
|
looking controls in the client area. -->
|
|
<assemblyIdentity type="win32"
|
|
name="Microsoft.Windows.Common-Controls"
|
|
version="6.0.0.0"
|
|
publicKeyToken="6595b64144ccf1df"
|
|
language="*"
|
|
processorArchitecture="*"/>
|
|
</dependentAssembly>
|
|
</dependency>
|
|
<!-- Declare us to be "DPI-aware". -->
|
|
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
|
<asmv3:windowsSettings
|
|
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
|
<dpiAware>true</dpiAware>
|
|
<dpiAwareness
|
|
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
|
PerMonitorV2
|
|
</dpiAwareness>
|
|
</asmv3:windowsSettings>
|
|
</asmv3:application>
|
|
</assembly>
|