From 886ee3ff1034fcddc43885f08c4f7872a18dbdc1 Mon Sep 17 00:00:00 2001 From: novist Date: Fri, 20 Feb 2015 18:17:30 +0200 Subject: [PATCH] Fixes #840 --- src/main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 76f6c9d9f..6cca408a2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -172,12 +172,17 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } } - else if (!ipc.isCurrentOwner() && !parser.isSet("p")) + else if (!ipc.isCurrentOwner()) { - time_t event = ipc.postEvent("activate"); - ipc.waitUntilProcessed(event); - if (!ipc.isCurrentOwner()) - return EXIT_SUCCESS; + uint32_t dest = 0; + if (parser.isSet("p")) + dest = Settings::getInstance().getCurrentProfileId(); + time_t event = ipc.postEvent("activate", QByteArray(), dest); + if (ipc.waitUntilProcessed(event, 2) && ipc.isEventAccepted(event)) + { + if (!ipc.isCurrentOwner()) + return EXIT_SUCCESS; + } } #endif