On Wed, 25 Mar 2026 06:27:08 GMT, Michael Strauß <[email protected]> wrote:
>> modules/javafx.graphics/src/main/native-glass/win/Utils.cpp line 120:
>>
>>> 118: * DPI-virtualize the returned coordinates.
>>> 119: *
>>> 120: * It is possible (though uncommon) for the JVM to run in a
>>> DPI-unaware or system-DPI-aware context.
>>
>> Do you have a recommended way of testing JavaFX as DPI unaware? This is hard
>> to do these days presumably due to the manifest you mention.
>
> I've only managed to do this by changing compatibility settings for the Java
> launcher (right-click on java.exe, go to properties->compatibility).
Have you tried using PhysicalToLogicalPointForPerMonitorDPI? I did some quick
tests and that call seems to be obeying the DPI awareness settings and
performing the correct conversions. Since it was introduced in Windows 8.1 it
can be called unconditionally. To access it you'll need to bump the Windows API
version up since it's currently set at 7. For my testing I bumped it up to 10
in common.h:
```
#define _GLASS_COMMON_
#ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0601
+ #define _WIN32_WINNT 0x0A00
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
@@ -37,6 +37,10 @@
#define _WIN32_WINNT_ _WIN32_WINNT
#endif
+#ifndef NTDDI_VERSION
+ #define NTDDI_VERSION NTDDI_WIN10
+#endif
+
#pragma warning(disable : 4675)
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1982#discussion_r2990522128