summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenu.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenu.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 3ac48df09e..14b8dee101 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -457,7 +457,9 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf
// Else, we need to transform 'pos' to window or screen coordinates.
NSPoint nsPos = NSMakePoint(pos.x() - 1, pos.y());
if (view) {
+ // Flip y-coordinate first, the convert to content view space.
nsPos.y = view.frame.size.height - nsPos.y;
+ nsPos = [view convertPoint:nsPos toView:view.window.contentView];
} else if (!QGuiApplication::screens().isEmpty()) {
QScreen *screen = QGuiApplication::screens().at(0);
nsPos.y = screen->availableVirtualSize().height() - nsPos.y;