summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-07-12 12:33:54 +0200
committerElvis Angelaccio <[email protected]>2017-07-13 17:30:36 +0200
commit69c3eba0ad5fe3bc4dec40c2eea4f336c0d7eea9 (patch)
tree1f3188c97a945d99fdd6595fb2dd997de40683cf
parentaa771da32d63d2fa7db93066fa3d42d7026ec9a4 (diff)
Fix knewstuff popup menu position on wayland
On Wayland we need to pass a parent to popup menus. See https://community.kde.org/Guidelines_and_HOWTOs/Wayland_Porting_Notes#Popup_Menus So we use the new setParentWidget() method from KNewStuff (introduced in Frameworks 5.37).
-rw-r--r--src/statusbar/statusbarspaceinfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp
index 03ab247..f364fcf 100644
--- a/src/statusbar/statusbarspaceinfo.cpp
+++ b/src/statusbar/statusbarspaceinfo.cpp
@@ -27,7 +27,7 @@
#include <KLocalizedString>
#include <KNS3/KMoreToolsMenuFactory>
#include <KIO/Job>
-
+#include <knewstuff_version.h>
StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) :
KCapacityBar(KCapacityBar::DrawTextInline, parent),
@@ -78,6 +78,9 @@ void StatusBarSpaceInfo::mousePressEvent(QMouseEvent* event)
// Note that this object must live long enough in case the user opens
// the "Configure..." dialog
KMoreToolsMenuFactory menuFactory(QStringLiteral("dolphin/statusbar-diskspace-menu"));
+#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 37, 0)
+ menuFactory.setParentWidget(this);
+#endif
auto menu = menuFactory.createMenuFromGroupingNames(
{ "disk-usage", "more:", "disk-partitions" }, m_url);