forked from pool/libqt5-qtbase
73a448f68a
- Add patch to fix tool menu placement (boo#1172754, QTBUG-84462): * 0001-Fix-QToolButton-menus-showing-on-primary-screens-in-.patch OBS-URL: https://build.opensuse.org/request/show/813233 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.15/libqt5-qtbase?expand=0&rev=11
38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
From f16d0e41bb638ffc1d83ca48321073eca1b86b42 Mon Sep 17 00:00:00 2001
|
|
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
Date: Wed, 10 Jun 2020 11:26:00 +0200
|
|
Subject: [PATCH] Fix QToolButton menus showing on primary screens in
|
|
multiscreen setups
|
|
|
|
Calculate an initial position based on the current size hint
|
|
and pass it to QMenuPrivate::exec(), which does screen checks
|
|
based on it.
|
|
|
|
Amends a78d66743171557d79b16c08be775e3ac15bb4ef.
|
|
|
|
Pick-to: 5.15
|
|
Fixes: QTBUG-84462
|
|
Task-number: QTBUG-78966
|
|
Change-Id: Icae8d2bc0fb50c4c853cfebaa2b2250fc06542e3
|
|
---
|
|
src/widgets/widgets/qtoolbutton.cpp | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
|
|
index edd4788806..0b090d2bac 100644
|
|
--- a/src/widgets/widgets/qtoolbutton.cpp
|
|
+++ b/src/widgets/widgets/qtoolbutton.cpp
|
|
@@ -805,7 +805,8 @@ void QToolButtonPrivate::popupTimerDone()
|
|
// QTBUG-78966, Delay positioning until after aboutToShow().
|
|
auto positionFunction = [q, horizontal](const QSize &sizeHint) {
|
|
return positionMenu(q, horizontal, sizeHint); };
|
|
- actualMenu->d_func()->exec({}, nullptr, positionFunction);
|
|
+ const auto initialPos = positionFunction(actualMenu->sizeHint());
|
|
+ actualMenu->d_func()->exec(initialPos, nullptr, positionFunction);
|
|
|
|
if (!that)
|
|
return;
|
|
--
|
|
2.25.1
|
|
|