diff options
Diffstat (limited to 'src/widgets/widgets/qmenu.cpp')
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 14964a696d..287be3e272 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -73,6 +73,7 @@ #endif #include "qpushbutton.h" #include "qtooltip.h" +#include <qwindow.h> #include <private/qpushbutton_p.h> #include <private/qaction_p.h> #include <private/qguiapplication_p.h> @@ -1485,6 +1486,8 @@ void QMenuPrivate::_q_platformMenuAboutToShow() { Q_Q(QMenu); + emit q->aboutToShow(); + #ifdef Q_OS_OSX if (platformMenu) { const auto actions = q->actions(); @@ -1498,8 +1501,6 @@ void QMenuPrivate::_q_platformMenuAboutToShow() } } #endif - - emit q->aboutToShow(); } bool QMenuPrivate::hasMouseMoved(const QPoint &globalPos) @@ -2328,8 +2329,10 @@ void QMenu::popup(const QPoint &p, QAction *atAction) d->motions = 0; d->doChildEffects = true; d->updateLayoutDirection(); - // Ensure that we get correct sizeHints by placing this window on the right screen. - d->setScreenForPoint(p); + + // Ensure that we get correct sizeHints by placing this window on the correct screen. + if (d->setScreenForPoint(p)) + d->itemsDirty = true; const bool contextMenu = d->isContextMenu(); if (d->lastContextMenu != contextMenu) { |