|
From: JVZ <je...@fo...> - 2021-02-08 14:03:29
|
On Mon, 8 Feb 2021 10:22:53 +0100
Francesco Abbate <fra...@gm...> wrote:
>Dear all, Jeroen,
>
>high DPI screens are more and more common and Windows is managing high
>dpi screens by scaling old applications that are not dpi-aware. For
>new applications there are some high dpi aware API that can be used to
>behave in the correct way.
>
>I think FOX is not high dpi aware so on Windows, on high dpi screens
>the applications look blurry.
>
>One very simple way to declare the application high dpi aware is to
>use the call:
>
>HINSTANCE lib = LoadLibrary("user32.dll");
>int (*SetProcessDPIAware)() = (void*) GetProcAddress(lib, "SetProcessDPIAware");
>SetProcessDPIAware();
It seems there are currently several ways to set it:
OLD (Vista):
BOOL SetProcessDPIAware();
NEWER (Windows 8.1):
HRESULT SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
NEWEST (Windows 10, >=1607)
BOOL SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT value);
The last two calls allow the app to indicate how the app wants to tackle
scaling, possibly on a per-monitor basis.
Cursory glance through the docs seems to indicate FOX might want to use
the latter call, with DPI_AWARENESS_CONTEXT_SYSTEM_AWARE mode to indicate
that we'd rather not have things automatically scaled.
The Vista and Windows 8 people [I feel for you guys!] may get short shrift
here but if we're going to deal with it properly then it seems calling
SetProcessDpiAwarenessContext() is the way to go.
Any comments??
>This is already sort of better, at least fonts are no longer blurry
>which is unsupportable to me personally. Unfortunately in this case
>FOX throws some assert in FXCursor.cpp:
>
> FXASSERT(GetSystemMetrics(SM_CXCURSOR)==32);
> FXASSERT(GetSystemMetrics(SM_CYCURSOR)==32);
>
>because these metrics can be bigger than 32. I think in this case we
>may need to provide bigger cursor images to blit them into the image
>bitmap area.
For now, I'll just delete these asserts. IFAIK, they've never triggered
for anybody, which means they were probably superfluous the whole time.
>I am wondering if we can fix this fairly simple problem with cursors
>waiting to have proper high dpi support.
>
>If you can provide me with some indications I may try to fix this by myself.
>
>In any case I appreciate any feedback and suggestions.
>
>Kind regards
>Francesco
Cheers,
-- JVZ
+----------------------------------------------------------------------------+
| Copyright (C) 11:40 01/12/2021 Jeroen van der Zijp. All Rights Reserved. |
+----------------------------------------------------------------------------+
|