summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2012-11-02 09:03:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-02 15:58:25 +0100
commitb2189acfc142397e8f3f547b0affdfc0b233fbb2 (patch)
treee370a9e3dcb853cd9d4038d574b56946bf52cde8 /src/plugins
parent324a41db458f2f662398a5895c28b1a18ef52b2d (diff)
Cocoa: Fix fonts on retina displays.
Hardcode logical dpi to 72 again. NSDeviceResolution gives us the physical dpi (144) and results in double- sized fonts in Qt. QPlatformScreen does not currently have a physicalDpi virtual, perhaps this can be added later on. Unfortunately the usefulness of a per-screen correct DPI metric seems questionable to me: 1) The value returned by the system is not correct, pixels per inch on the rMBP is around 220. 2) Qt always uses the dpi for the main screen, via qt_defaltDpiX/Y. Change-Id: Ia35804be62ee7f1c623bad854f65d744dc9075d4 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 481055aae4..f17e97c115 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -97,9 +97,8 @@ void QCocoaScreen::updateGeometry()
CGDirectDisplayID dpy = [[devDesc objectForKey:@"NSScreenNumber"] unsignedIntValue];
CGSize size = CGDisplayScreenSize(dpy);
m_physicalSize = QSizeF(size.width, size.height);
- NSSize resolution = [[devDesc valueForKey:NSDeviceResolution] sizeValue];
- m_logicalDpi.first = resolution.width;
- m_logicalDpi.second = resolution.height;
+ m_logicalDpi.first = 72;
+ m_logicalDpi.second = 72;
m_refreshRate = CGDisplayModeGetRefreshRate(CGDisplayCopyDisplayMode(dpy));
// Get m_name (brand/model of the monitor)
@@ -110,7 +109,7 @@ void QCocoaScreen::updateGeometry()
[deviceInfo release];
QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry());
- QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(), resolution.width, resolution.height);
+ QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(), m_logicalDpi.first, m_logicalDpi.second);
QWindowSystemInterface::handleScreenRefreshRateChange(screen(), m_refreshRate);
QWindowSystemInterface::handleScreenAvailableGeometryChange(screen(), availableGeometry());
}