diff --git a/kded/daemon.h b/kded/daemon.h --- a/kded/daemon.h +++ b/kded/daemon.h @@ -71,6 +71,7 @@ void monitorConnectedChange(); static KScreen::OutputPtr findEmbeddedOutput(const KScreen::ConfigPtr &config); void disableOutput(KScreen::ConfigPtr &config, KScreen::OutputPtr &output); + void showOsd(const QString &icon, const QString &text); KScreen::ConfigPtr m_monitoredConfig; Generator::DisplaySwitchAction m_iteration; diff --git a/kded/daemon.cpp b/kded/daemon.cpp --- a/kded/daemon.cpp +++ b/kded/daemon.cpp @@ -216,9 +216,28 @@ } } +void KScreenDaemon::showOsd(const QString &icon, const QString &text) +{ + QDBusMessage msg = QDBusMessage::createMethodCall( + QLatin1Literal("org.kde.plasmashell"), + QLatin1Literal("/org/kde/osdService"), + QLatin1Literal("org.kde.osdService"), + QLatin1Literal("showText") + ); + msg << icon << text; + QDBusConnection::sessionBus().asyncCall(msg); +} + void KScreenDaemon::displayButton() { qCDebug(KSCREEN_KDED) << "displayBtn triggered"; + + QString message = i18nc("OSD text after XF86Display button press", "No External Display"); + if (m_monitoredConfig && m_monitoredConfig->connectedOutputs().count() > 1) { + message = i18nc("OSD text after XF86Display button press", "Changing Screen Layout"); + } + showOsd(QStringLiteral("preferences-desktop-display-randr"), message); + if (m_buttonTimer->isActive()) { qCDebug(KSCREEN_KDED) << "Too fast, cowboy"; return;