Skip to content

Commit

Permalink
Do not load GetWindowDpiAwarenessContext until its needed
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <[email protected]>
  • Loading branch information
nulano and radarhere authored Nov 7, 2024
1 parent 4b88670 commit a6c941a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
user32 = LoadLibraryA("User32.dll");
SetThreadDpiAwarenessContext_function = (Func_SetThreadDpiAwarenessContext
)GetProcAddress(user32, "SetThreadDpiAwarenessContext");
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
if (SetThreadDpiAwarenessContext_function != NULL) {
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
if (screens == -1 && GetWindowDpiAwarenessContext_function != NULL) {
dpiAwareness =
GetWindowDpiAwarenessContext_function(wnd);
Expand Down

0 comments on commit a6c941a

Please sign in to comment.