From: Elvis Angelaccio Date: Wed, 12 Jul 2017 10:33:54 +0000 (+0200) Subject: Fix knewstuff popup menu position on wayland X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/69c3eba0ad5fe3bc4dec40c2eea4f336c0d7eea9 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). --- diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp index 03ab247ca..f364fcf5b 100644 --- a/src/statusbar/statusbarspaceinfo.cpp +++ b/src/statusbar/statusbarspaceinfo.cpp @@ -27,7 +27,7 @@ #include #include #include - +#include 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);