Fallback to PER_MONITOR_AWARE if GetWindowDpiAwarenessContext is not available

Co-authored-by: Ondrej Baranovič <ondreko.tiba@gmail.com>
This commit is contained in:
Andrew Murray 2024-11-08 07:45:29 +11:00 committed by GitHub
parent 7763350f07
commit a44b3067b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -365,7 +365,7 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
DPI_AWARENESS_CONTEXT dpiAwarenessContext =
GetWindowDpiAwarenessContext_function(wnd);
if (dpiAwarenessContext != NULL) {
if (GetWindowDpiAwarenessContext_function != NULL && dpiAwarenessContext != NULL) {
dpiAwareness =
SetThreadDpiAwarenessContext_function(dpiAwarenessContext);
} else {