From cf2d64fa9718c27f5f36101c9d2eb8dda79eeb77 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 22 Mar 2018 19:54:03 +0100 Subject: [PATCH] Set a transient parent for SNI context menus Summary: Those had no transient parent set, so they got displayed somewhere, most of the time on the wrong screen. Test Plan: Works fine for spotify and kteatime now, but certain applications which trigger a LayoutChanged signal on the opened event have a Y offset. Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D11584 --- applets/systemtray/systemtray.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp index 25bd15878..0c0c669ec 100644 --- a/applets/systemtray/systemtray.cpp +++ b/applets/systemtray/systemtray.cpp @@ -293,8 +293,9 @@ void SystemTray::showStatusNotifierContextMenu(KJob *job, QQuickItem *statusNoti } } - KAcceleratorManager::manage(menu); + menu->winId(); + menu->windowHandle()->setTransientParent(statusNotifierIcon->window()); menu->popup(QPoint(x, y)); } }