From 34d212cb02f168e59c2a5c8e95a12377a57bfb7e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 6 Jun 2018 09:08:33 +0200 Subject: QMenuBar: Account for displays that are above 0x0 If a display is placed above a primary screen which has the top left set to be 0x0, then menus that are defaulting to go up can still be displayed on that screen when the menubar is placed on the bottom of it. This ensures that this is the case and also adds a manual test to aid verification of it in the future. Change-Id: Ib657ccdc1aabfe1586c72585c087ac80a6c632c2 Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qmenubar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 7c4dd896a4..6df53dc4e4 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -327,7 +327,7 @@ void QMenuBarPrivate::popupAction(QAction *action, bool activateFirst) QRect screenRect = QDesktopWidgetPrivate::screenGeometry(pos + QPoint(adjustedActionRect.width() / 2, 0)); pos = QPoint(qMax(pos.x(), screenRect.x()), qMax(pos.y(), screenRect.y())); - const bool fitUp = (q->mapToGlobal(adjustedActionRect.topLeft()).y() >= popup_size.height()); + const bool fitUp = (pos.y() - popup_size.height() >= screenRect.top()); const bool fitDown = (pos.y() + popup_size.height() <= screenRect.bottom()); const bool rtl = q->isRightToLeft(); const int actionWidth = adjustedActionRect.width(); -- cgit v1.2.3