From b5c713443ea7eeae525799cb9119c101a8c8b4cd Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 18 Jul 2026 23:56:24 +0200 Subject: [PATCH] krunner: launch ollie-gui when selecting a session from list If the GUI is not already running, start it via QProcess and poll for D-Bus registration before sending SelectSession. --- krunner/ollie_runner.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/krunner/ollie_runner.cpp b/krunner/ollie_runner.cpp index f06bdb7..473405d 100644 --- a/krunner/ollie_runner.cpp +++ b/krunner/ollie_runner.cpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include K_PLUGIN_CLASS_WITH_JSON(OllieRunner, "metadata.json") @@ -201,6 +203,19 @@ void OllieRunner::run(const RunnerNS::RunnerContext &context, const RunnerNS::Qu QDBusConnection::sessionBus()); if (gui.isValid()) { gui.call(QDBus::NoBlock, "SelectSession", sessionId); + } else { + // GUI not running — launch it, then ask it to select the session + QProcess::startDetached("ollie-gui", {}); + // Poll for D-Bus registration (up to 3 seconds) + for (int i = 0; i < 30; ++i) { + QThread::msleep(100); + QDBusInterface retry("org.ollie.Gui", "/org/ollie/Gui", "org.ollie.Gui", + QDBusConnection::sessionBus()); + if (retry.isValid()) { + retry.call(QDBus::NoBlock, "SelectSession", sessionId); + break; + } + } } }