summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-01-04 07:31:22 +0100
committerLiang Qi <liang.qi@qt.io>2019-01-04 07:33:14 +0100
commit03039979b5a643f9def38a73e19835bb69384202 (patch)
treee8a9184d5963128f013247ac64ec768d1cbf6911 /src/widgets/widgets/qmenu.cpp
parent9682d217e21a2e88b6de799d79b843bbe0039df1 (diff)
parent4dc2bc323c985bdceb27f096dd6c8e7af657bb6b (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
Diffstat (limited to 'src/widgets/widgets/qmenu.cpp')
-rw-r--r--src/widgets/widgets/qmenu.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index bf1102434c..5927331305 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -896,23 +896,6 @@ void QMenuPrivate::_q_overrideMenuActionDestroyed()
menuAction=defaultMenuAction;
}
-void QMenuPrivate::adjustMenuScreen(const QPoint &p)
-{
- Q_Q(QMenu);
- // The windowHandle must point to the screen where the menu will be shown.
- // The (item) size calculations depend on the menu screen,
- // so a wrong screen would often cause wrong sizes (on high DPI)
- const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : nullptr;
- QScreen *actualScreen = QGuiApplication::screenAt(p);
- if (actualScreen && currentScreen != actualScreen) {
- if (!q->windowHandle()) // Try to create a window handle if not created.
- createWinId();
- if (q->windowHandle())
- q->windowHandle()->setScreen(actualScreen);
- itemsDirty = true;
- }
-}
-
void QMenuPrivate::updateLayoutDirection()
{
Q_Q(QMenu);
@@ -2347,7 +2330,8 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
d->motions = 0;
d->doChildEffects = true;
d->updateLayoutDirection();
- d->adjustMenuScreen(p);
+ // Ensure that we get correct sizeHints by placing this window on the right screen.
+ d->setScreenForPoint(p);
const bool contextMenu = d->isContextMenu();
if (d->lastContextMenu != contextMenu) {