summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-06-06 09:08:33 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-06-29 05:37:13 +0000
commit34d212cb02f168e59c2a5c8e95a12377a57bfb7e (patch)
tree4946586b81f3fa57d28912b2788a7d50b545709d /src
parent7f7ceb567fe2f58b47b66415f30918f3b482f2b0 (diff)
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 <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qmenubar.cpp2
1 files changed, 1 insertions, 1 deletions
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();