[
https://issues.apache.org/jira/browse/NETBEANS-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16666171#comment-16666171
]
Eirik Bakke commented on NETBEANS-1227:
---------------------------------------
This fix might affect the way Windows decides on DPI settings for applications
run from the IDE as well, yes. I'm not sure exactly how the IDE launches
applications under development when you hit "run", but I suspect it depends on
whether you are running an ant or maven project, and on whether you are running
a NetBeans IDE under development or a regular Java application.
When you run the Dev IDE, you're probably running it on Java 8 (since it's
usually built on Java 8 as well). Java 8 has no HiDPI support, so everything
becomes tiny or blurry (tiny in this case probably because Windows assumes
NetBeans and all its child processes, or perhaps launcher binaries, support
HiDPI).
You could (1) run the Dev IDE on Java 9 or above (2) use the old trick to
override DPI settings for all of NetBeans (see if you can find a setting that
works) or (3) try to find whatever launcher EXE file is being used to actually
launch the dev IDE (nbexec64.exe? or perhaps netbeans64.exe in the
nbbuild\netbeans\bin directory?), and override DPI settings for that EXE file
specifically (right-click, Properties etc.).
> 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, pull-request-available
> Fix For: 10.0
>
> Attachments: SmallIconsRun.png
>
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> 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: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists