Skip to content

Commit a44b306

Browse files
radarherenulano
andauthored
Fallback to PER_MONITOR_AWARE if GetWindowDpiAwarenessContext is not available
Co-authored-by: Ondrej Baranovič <[email protected]>
1 parent 7763350 commit a44b306

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
365365
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
366366
DPI_AWARENESS_CONTEXT dpiAwarenessContext =
367367
GetWindowDpiAwarenessContext_function(wnd);
368-
if (dpiAwarenessContext != NULL) {
368+
if (GetWindowDpiAwarenessContext_function != NULL && dpiAwarenessContext != NULL) {
369369
dpiAwareness =
370370
SetThreadDpiAwarenessContext_function(dpiAwarenessContext);
371371
} else {

0 commit comments

Comments
 (0)