From f2cbbba0f60535d598dd3f4c9eac57042c57727a Mon Sep 17 00:00:00 2001 From: Tranter Madi Date: Mon, 15 Mar 2021 16:40:50 +0000 Subject: [PATCH] Show Settings window when another instance is running --- app/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/main.cpp b/app/main.cpp index 46787c2c9..0497500d1 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include #include @@ -233,6 +235,12 @@ int main(int argc, char **argv) } if (!lockFile.tryLock(timeout)) { + QDBusInterface iface("org.kde.lattedock", "/Latte", "", QDBusConnection::sessionBus()); + if (iface.isValid()) { + // LayoutPage = 0 + iface.call("showSettingsWindow", 0); + } + qInfo() << i18n("An instance is already running!, use --replace to restart Latte"); qGuiApp->exit(); return 0;