Skip to content

Commit a6c941a

Browse files
nulanoradarhere
andauthored
Do not load GetWindowDpiAwarenessContext until its needed
Co-authored-by: Andrew Murray <[email protected]>
1 parent 4b88670 commit a6c941a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
359359
user32 = LoadLibraryA("User32.dll");
360360
SetThreadDpiAwarenessContext_function = (Func_SetThreadDpiAwarenessContext
361361
)GetProcAddress(user32, "SetThreadDpiAwarenessContext");
362-
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
363-
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
364362
if (SetThreadDpiAwarenessContext_function != NULL) {
363+
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
364+
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
365365
if (screens == -1 && GetWindowDpiAwarenessContext_function != NULL) {
366366
dpiAwareness =
367367
GetWindowDpiAwarenessContext_function(wnd);

0 commit comments

Comments
 (0)