Bug 1254026 - followup - Apply the same fix to the Print dialog. r=emk a=gchang
authorJonathan Kew <jkew@mozilla.com>
Fri, 01 Jul 2016 23:58:31 +0100
changeset 340037 70ca7c42db312a2a07aad0560aff0bd1fc48de02
parent 340036 59e0323f3db6d891daa2389dd8716d9bfb0c83a0
child 340038 b283934782589961e1585b2ea130c92ad0883789
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk, gchang
bugs1254026
milestone49.0a2
Bug 1254026 - followup - Apply the same fix to the Print dialog. r=emk a=gchang
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;
     }