startupfeedback: Restore trigger from Plasma

This commit is contained in:
Devin Lin 2023-03-18 19:01:48 -07:00
parent b1e0d41505
commit 0c2f215a3f
2 changed files with 16 additions and 11 deletions

View file

@ -10,9 +10,9 @@ import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.13 as Kirigami import org.kde.kirigami 2.13 as Kirigami
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.plasma.private.mobileshell.state as MobileShellState
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
/** /**
* Component that animates an app opening from a location. * Component that animates an app opening from a location.
@ -64,15 +64,15 @@ MouseArea { // use mousearea to ensure clicks don't go behind
} }
// open startupfeedback when notifier gives an app // open startupfeedback when notifier gives an app
// Connections { Connections {
// target: NanoShell.StartupNotifier target: WindowPlugin.WindowUtil
// enabled: NanoShell.StartupNotifier.isValid
// function onAppActivationStarted(appId, iconName) {
// function onActivationStarted(appId, iconName) { console.log(appId);
// icon.source = iconName icon.source = iconName
// openAnimSimple.restart(); openAnimSimple.restart();
// } }
// } }
Kirigami.ImageColors { Kirigami.ImageColors {
id: colorGenerator id: colorGenerator

View file

@ -80,6 +80,11 @@ void WindowUtil::initWayland()
connect(iface, &PlasmaActivationFeedback::activation, this, [this](PlasmaActivation *activation) { connect(iface, &PlasmaActivationFeedback::activation, this, [this](PlasmaActivation *activation) {
connect(activation, &PlasmaActivation::applicationId, this, [this](const QString &appId) { connect(activation, &PlasmaActivation::applicationId, this, [this](const QString &appId) {
// do not show activation screen for the plasmashell process
if (appId == "org.kde.plasmashell") {
return;
}
const auto servicesFound = KApplicationTrader::query([&appId](const KService::Ptr &service) { const auto servicesFound = KApplicationTrader::query([&appId](const KService::Ptr &service) {
if (service->exec().isEmpty()) if (service->exec().isEmpty())
return false; return false;