Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[compositor] Attempt to replace compositor D-Bus service. JB#46305
There might be a compositor service waiting on D-Bus for lipstick to
replace it but in order for that to work, both processes must use
appropriate name registration options.

Use ReplaceExistingService flag so that existing compositor service
that has volunteered to be replaced will lose name ownership.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jun 20, 2019
1 parent 91d18a5 commit 641e9d9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/compositor/lipstickcompositor.cpp
Expand Up @@ -408,8 +408,21 @@ void LipstickCompositor::initialize()
if (!systemBus.registerObject("/", this)) {
qWarning("Unable to register object at path /: %s", systemBus.lastError().message().toUtf8().constData());
}
if (!systemBus.registerService("org.nemomobile.compositor")) {
qWarning("Unable to register D-Bus service org.nemomobile.compositor: %s", systemBus.lastError().message().toUtf8().constData());

/* We might have for example minui based encryption unlock ui
* running as compositor and waiting to be able to hand-off
* to us -> use ReplaceExistingService to facilitate this.
*/
QDBusReply<QDBusConnectionInterface::RegisterServiceReply> reply =
systemBus.interface()->registerService(QStringLiteral("org.nemomobile.compositor"),
QDBusConnectionInterface::ReplaceExistingService,
QDBusConnectionInterface::DontAllowReplacement);
if (!reply.isValid()) {
qWarning("Unable to register D-Bus service org.nemomobile.compositor: %s",
reply.error().message().toUtf8().constData());
} else if (reply.value() != QDBusConnectionInterface::ServiceRegistered) {
qWarning("Unable to register D-Bus service org.nemomobile.compositor: %s",
"Did not get primary name ownership");
}
}

Expand Down

0 comments on commit 641e9d9

Please sign in to comment.