summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu.cpp
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2019-05-22 09:32:05 +0200
committerThorbjørn Lund Martsum <tmartsum@gmail.com>2019-05-22 11:22:26 +0200
commit48f7f65dc34a9ef97d6b4cbca5fc251a7127f1a9 (patch)
tree803f699caae9505ed8db21e2a1c639d8a25147da /src/widgets/widgets/qmenu.cpp
parentd661a22ae283c604e9e95eceeaf4e6b47e7e1753 (diff)
QMenu size fix - Mark items dirty on screen change
It seems like an optimization on the itemsDirty flag caused a bug to be re-introduced. When a popup is shown on a new screen, the itemsDirty must however be set to ensure that new correct sizes are calculated. Task-number: QTBUG-59794 Change-Id: Ifb5c233b1f9d4d38bd0cd7a9a71cc32ad3212f8c Reviewed-by: Morten Kristensen <msk@nullpointer.dk> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/widgets/widgets/qmenu.cpp')
-rw-r--r--src/widgets/widgets/qmenu.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index a8cca2ae3a..5b1f609b7e 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>
@@ -2356,8 +2357,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) {