--- gtk+-0d30ad2/gdk/win32/gdkdisplay-win32.h.orig	2016-07-01 21:33:41.235529900 +0000
+++ gtk+-0d30ad2/gdk/win32/gdkdisplay-win32.h	2016-07-01 22:24:59.740513500 +0000
@@ -36,6 +36,12 @@
                                                       GdkWin32MonitorDpiType  dpi_type,
                                                       UINT                   *dpi_x,
                                                       UINT                   *dpi_y);
+/* These functions are from user32.dll, but might be missing from
+ * MinGW-w64 import library, if it's too old.
+ */
+typedef BOOL (WINAPI *funcSetProcessDPIAware)        (void);
+typedef BOOL (WINAPI *funcIsProcessDPIAware)         (void);
+
 
 typedef struct _GdkWin32ShcoreFuncs
 {
@@ -43,6 +49,8 @@
   funcSetProcessDpiAwareness setDpiAwareFunc;
   funcGetProcessDpiAwareness getDpiAwareFunc;
   funcGetDpiForMonitor getDpiForMonitorFunc;
+  funcSetProcessDPIAware setProcessDPIAwareFunc;
+  funcIsProcessDPIAware isProcessDPIAwareFunc;
 } GdkWin32ShcoreFuncs;
 
 struct _GdkWin32Display
--- gtk+-0d30ad2/gdk/win32/gdkdisplay-win32.c.orig	2016-07-01 21:33:41.234529900 +0000
+++ gtk+-0d30ad2/gdk/win32/gdkdisplay-win32.c	2016-07-01 22:29:23.597603100 +0000
@@ -886,25 +886,49 @@
     }
   else
     {
+      HMODULE user32;
+
       /* For Windows Vista through 8, use SetProcessDPIAware() */
       display->have_at_least_win81 = FALSE;
-      if (SetProcessDPIAware () != 0)
+
+      /* user32.dll should already be loaded, just get its address */
+      user32 = GetModuleHandleW (L"user32.dll");
+      display->shcore_funcs.setProcessDPIAwareFunc =
+        (funcSetProcessDPIAware) GetProcAddress (user32,
+                                                 "SetProcessDPIAware");
+      display->shcore_funcs.isProcessDPIAwareFunc =
+        (funcIsProcessDPIAware) GetProcAddress (user32,
+                                                "IsProcessDPIAware");
+      if (user32 == NULL ||
+          display->shcore_funcs.setProcessDPIAwareFunc == NULL ||
+          display->shcore_funcs.isProcessDPIAwareFunc == NULL)
         {
-          display->dpi_aware_type = PROCESS_SYSTEM_DPI_AWARE;
-          status = DPI_STATUS_SUCCESS;
+          /* This should not happen */
+          g_assert_not_reached ();
+          display->dpi_aware_type = PROCESS_DPI_UNAWARE;
+          status = DPI_STATUS_FAILED;
         }
       else
         {
-          /* This most probably means DPI awareness is set through
-             the manifest, or a DPI compatibility setting is used. */
-          display->dpi_aware_type = IsProcessDPIAware () ?
-                                    PROCESS_SYSTEM_DPI_AWARE :
-                                    PROCESS_DPI_UNAWARE;
-
-          if (display->dpi_aware_type == PROCESS_SYSTEM_DPI_AWARE)
-            status = DPI_STATUS_SUCCESS;
+          if (display->shcore_funcs.setProcessDPIAwareFunc () != 0)
+            {
+              display->dpi_aware_type = PROCESS_SYSTEM_DPI_AWARE;
+              status = DPI_STATUS_SUCCESS;
+            }
           else
-            status = DPI_STATUS_DISABLED;
+            {
+              /* This most probably means DPI awareness is set through
+                 the manifest, or a DPI compatibility setting is used. */
+              if (display->shcore_funcs.isProcessDPIAwareFunc ())
+                display->dpi_aware_type = PROCESS_SYSTEM_DPI_AWARE;
+              else
+                display->dpi_aware_type = PROCESS_DPI_UNAWARE;
+
+              if (display->dpi_aware_type == PROCESS_SYSTEM_DPI_AWARE)
+                status = DPI_STATUS_SUCCESS;
+              else
+                status = DPI_STATUS_DISABLED;
+            }
         }
     }
 
