You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Eirik Bakke (JIRA)" <ji...@apache.org> on 2018/09/13 15:52:00 UTC
[jira] [Comment Edited] (NETBEANS-1227) Mark Windows launcher
binary as per-monitor DPI aware
[ https://issues.apache.org/jira/browse/NETBEANS-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613681#comment-16613681 ]
Eirik Bakke edited comment on NETBEANS-1227 at 9/13/18 3:51 PM:
----------------------------------------------------------------
The manifest in Java 11 is updated to mark Java as having "PerMonitorV2" support. This fixes another issue where title bars would appear too small or too large in a multi-monitor setup involving one HiDPI screen; see https://bugs.openjdk.java.net/browse/JDK-8199627 . The NetBeans IDE and Platform launchers should do the same. It wouldn't hurt to include the "compatibility" section of the manifest as well, to tell Windows explicitly that Java (and by extension, NetBeans) supports Windows 8.1, Windows 10 etc. Here are the relevant sections from javaw.exe in JDK 11ea:
{code:xml}
<asmv3:application>
<asmv3:windowsSettings xmlns:dpi1="http://schemas.microsoft.com/SMI/2005/WindowsSettings" xmlns:dpi2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpi1:dpiAware>true/PM</dpi1:dpiAware>
<dpi2:dpiAwareness>PerMonitorV2, PerMonitor, system</dpi2:dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
{code}
was (Author: ebakke):
The manifest in Java 11 is updated to mark Java as having "PerMonitorV2" support. See https://bugs.openjdk.java.net/browse/JDK-8199627 . The NetBeans IDE and Platform launchers should do the same. It wouldn't hurt to include the "compatibility" section of the manifest as well, to tell Windows explicitly that Java (and by extension, NetBeans) supports Windows 8.1, Windows 10 etc. Here are the relevant sections from javaw.exe in JDK 11ea:
{code:xml}
<asmv3:application>
<asmv3:windowsSettings xmlns:dpi1="http://schemas.microsoft.com/SMI/2005/WindowsSettings" xmlns:dpi2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpi1:dpiAware>true/PM</dpi1:dpiAware>
<dpi2:dpiAwareness>PerMonitorV2, PerMonitor, system</dpi2:dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
{code}
> Mark Windows launcher binary as per-monitor DPI aware
> -----------------------------------------------------
>
> Key: NETBEANS-1227
> URL: https://issues.apache.org/jira/browse/NETBEANS-1227
> Project: NetBeans
> Issue Type: Bug
> Components: platform - Launchers&CLI
> Affects Versions: 9.0
> Environment: Windows 8.1 and Windows 10
> Reporter: Eirik Bakke
> Priority: Major
> Labels: HiDPI
>
> As of Java 10.0.2, support for HiDPI monitors on Windows is quite good. All the standard Swing components appear in high resolution, and Graphics2D surfaces are automatically scaled appropriately for whichever monitor their containing window is located on, including when windows are dragged between monitors in a mixed-DPI multi-monitor setting.
> For this to work, however, the EXE file that launches NetBeans must contain a manifest that declares the application to be DPI-aware. Such a manifest currently exists in java.exe and javaw.exe, but not in the custom netbeans64.exe launcher. A workaround for the missing manifest is to right click the "bin\netbeans64.exe" file, or whichever shortcut is being used to open NetBeans, go to the "Compatibility" tab, click "Change high DPI settings", "Override high DPI scaling behavior", and select scaling performed by "Application".
> An appropriate manifest should be added to netbeans64.exe to declare NetBeans as per-monitor DPI aware.
> To see how the manifest should be declared, we can dump the manifest of javaw.exe:
> {code:xml}
> <?xml version="1.0"?>
> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
> <assemblyIdentity name="javaw.exe" version="10.0.2.0" processorArchitecture="X86" type="win32"/>
> <description>Java(TM) SE process</description>
> <!-- More stuff goes here. --->
> <asmv3:application>
> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
> <dpiAware>true/PM</dpiAware>
> </asmv3:windowsSettings>
> </asmv3:application>
> <!-- More stuff goes here. --->
> </assembly>
> {code}
> This reveals that Java 10.0.2 considers itself DPI-aware at the "Per Monitor V1" level (see the Microsoft documentation linked below). The NetBeans launcher binary should declare the same.
> References:
> [https://docs.microsoft.com/en-us/windows/desktop/hidpi/high-dpi-desktop-application-development-on-windows]
> [https://msdn.microsoft.com/en-us/library/windows/desktop/mt846517(v=vs.85).aspx]
> [https://docs.microsoft.com/en-us/windows/desktop/sbscs/application-manifests]
> [https://blogs.msdn.microsoft.com/mithuns/2009/12/16/random-how-to-quickly-view-a-binarys-embedded-manifest]
> [https://docs.microsoft.com/en-us/sysinternals/downloads/sigcheck]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists