summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoahelpers.mm
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-10-26 12:35:52 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-27 09:38:26 +0200
commit3849455ee791d6f5cd4b87253732827d40e5d28a (patch)
treee4882153eb7b03db3fffbeec9fedd03fbc16c31b /src/plugins/platforms/cocoa/qcocoahelpers.mm
parentdb44fdf4d65493706dc9a0aaf5e58729dc7867f9 (diff)
Cocoa: Set correct child window geometry.
Remote globalGeometry which was completely wrong, replace with flipRect which converts from Qt screen coordinates to OS X screen coordinates. Change-Id: Ie560cb7c2266fe779da8a44a35596d2d12af77f5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoahelpers.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 113415f480..9777e0c473 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -450,3 +450,10 @@ QString qt_mac_applicationName()
return appName;
}
+NSRect qt_mac_flipRect(const QRect &rect, QWindow *window)
+{
+ QPlatformScreen *onScreen = QPlatformScreen::platformScreenForWindow(window);
+ int flippedY = onScreen->geometry().height() - rect.y() - rect.height();
+ return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height());
+}
+