From a44b3067b0e31d6c3a89ba270db20b1a1a71d226 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Fri, 8 Nov 2024 07:45:29 +1100 Subject: [PATCH] Fallback to PER_MONITOR_AWARE if GetWindowDpiAwarenessContext is not available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondrej Baranovič --- src/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display.c b/src/display.c index da248443c..f28926427 100644 --- a/src/display.c +++ b/src/display.c @@ -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 {