From 75d90253ab4a6057fd6b3b1a004c67847638a990 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 22 Mar 2021 18:35:20 +0100 Subject: [PATCH] Make sure preference window properly activates by using KStartupInfo::setNewStartupId it properly activateswithout getting blocked by Kwin focus stealing protection also when remotely invoked from dbus --- shell/desktopview.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/shell/desktopview.cpp b/shell/desktopview.cpp index 790f748fb..8fed773ee 100644 --- a/shell/desktopview.cpp +++ b/shell/desktopview.cpp @@ -31,12 +31,15 @@ #include #include #include +#include #include #include #include +#include + DesktopView::DesktopView(Plasma::Corona *corona, QScreen *targetScreen) : PlasmaQuick::ContainmentView(corona, nullptr) , m_windowType(Desktop) @@ -285,6 +288,10 @@ void DesktopView::showConfigurationInterface(Plasma::Applet *applet) m_configView->deleteLater(); } else { m_configView->show(); + auto window = qobject_cast(m_configView); + if (window && QX11Info::isPlatformX11()) { + KStartupInfo::setNewStartupId(window, QX11Info::nextStartupId()); + } m_configView->requestActivate(); return; } @@ -310,6 +317,12 @@ void DesktopView::showConfigurationInterface(Plasma::Applet *applet) m_configView.data()->setTransientParent(this); m_configView.data()->show(); m_configView->requestActivate(); + + auto window = qobject_cast(m_configView); + if (window && QX11Info::isPlatformX11()) { + KStartupInfo::setNewStartupId(window, QX11Info::nextStartupId()); + } + m_configView->requestActivate(); } void DesktopView::screenGeometryChanged()