From b38434e3601866b6bd97eedf6d14b0e4d0b3f535 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Fri, 20 Jan 2006 20:08:02 +0000 Subject: [PATCH] Make DPI preference behave the same on OS/2 as on Unixes. r=mkaply sr=roc b=323964 --- gfx/src/os2/nsDeviceContextOS2.cpp | 14 ++++++++------ modules/libpref/src/init/all.js | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gfx/src/os2/nsDeviceContextOS2.cpp b/gfx/src/os2/nsDeviceContextOS2.cpp index 97152ab2050..6b5aa92139e 100644 --- a/gfx/src/os2/nsDeviceContextOS2.cpp +++ b/gfx/src/os2/nsDeviceContextOS2.cpp @@ -573,16 +573,18 @@ nsDeviceContextOS2::SetDPI(PRInt32 aPrefDPI) GFX (::DevQueryCaps(hdc, CAPS_HORIZONTAL_FONT_RES, 1, &OSVal), FALSE); ::WinReleasePS(ps); - if (aPrefDPI == 0) { - // If the pref is 0 use of OS value - mDpi = OSVal; - } else if (aPrefDPI > 0) { + if (aPrefDPI > 0) { // If there's a valid pref value for the logical resolution, // use it. mDpi = aPrefDPI; + } else if ((aPrefDPI == 0) || (OSVal > 96)) { + // Either if the pref is 0 (force use of OS value) or the OS + // value is bigger than 96, use the OS value. + mDpi = OSVal; } else { - // if we couldn't get the pref or it's negative then use 120 - mDpi = 120; + // if we couldn't get the pref or it's negative, and the OS + // value is under 96ppi, then use 96. + mDpi = 96; } int pt2t = 72; diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 81aa33e0517..0dfc86d4a64 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -1518,7 +1518,7 @@ pref("network.dns.disableIPv6", true); #if XP_OS2 pref("ui.key.menuAccessKeyFocuses", true); -pref("browser.display.screen_resolution", 0); // System setting +pref("browser.display.screen_resolution", -1); // max(96dpi, System setting) /* Fonts only needs lists if we have a default that might not be available. */ /* Tms Rmn, Helv and Courier are ALWAYS available on OS/2 */