Bug 1254026 - followup - Apply the same fix to the Print dialog. r=emk
authorJonathan Kew <jkew@mozilla.com>
Fri, 01 Jul 2016 23:58:31 +0100
changeset 303463 5c98fa080b96a19d4ed2dc6947c78ba7240fe19b
parent 303462 1b782dcb677abdbbeade064e3321a87505b7d0c9
child 303464 d9ecb9d04a90e5ecddbf85b417d789bf2f5652c7
push id19853
push usercbook@mozilla.com
push dateMon, 04 Jul 2016 11:08:46 +0000
treeherderfx-team@4191df8e4b8e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs1254026
milestone50.0a1
Bug 1254026 - followup - Apply the same fix to the Print dialog. r=emk
embedding/components/printingui/win/nsPrintDialogUtil.cpp
--- a/embedding/components/printingui/win/nsPrintDialogUtil.cpp
+++ b/embedding/components/printingui/win/nsPrintDialogUtil.cpp
@@ -51,16 +51,17 @@ WIN_LIBS=                               
 
 // For NS_CopyUnicodeToNative
 #include "nsNativeCharsetUtils.h"
 
 // This is for extending the dialog
 #include <dlgs.h>
 
 #include "nsWindowsHelpers.h"
+#include "WinUtils.h"
 
 // Default labels for the radio buttons
 static const char* kAsLaidOutOnScreenStr = "As &laid out on the screen";
 static const char* kTheSelectedFrameStr  = "The selected &frame";
 static const char* kEachFrameSeparately  = "&Each frame separately";
 
 
 //-----------------------------------------------
@@ -660,17 +661,21 @@ ShowNativePrintDialog(HWND              
     prntdlg.lpfnPrintHook     = nullptr;
   } else {
     // Set up print dialog "hook" procedure for extending the dialog
     prntdlg.lCustData         = (DWORD)howToEnableFrameUI;
     prntdlg.lpfnPrintHook     = (LPPRINTHOOKPROC)PrintHookProc;
     prntdlg.Flags            |= PD_ENABLEPRINTHOOK;
   }
 
-  BOOL result = ::PrintDlgW(&prntdlg);
+  BOOL result;
+  {
+    mozilla::widget::WinUtils::AutoSystemDpiAware dpiAwareness;
+    result = ::PrintDlgW(&prntdlg);
+  }
 
   if (TRUE == result) {
     // check to make sure we don't have any nullptr pointers
     NS_ENSURE_TRUE(aPrintSettings && prntdlg.hDevMode, NS_ERROR_FAILURE);
 
     if (prntdlg.hDevNames == nullptr) {
       return NS_ERROR_FAILURE;
     }