Register unique service name when wayland keyboard interface is in use

A situation meant we want to only enable the new keyboard applet by
default on wayland, using the legacy one from the X11 daemon on X11.

We need a unique service name so that we can use DBus activation on it.
icc-effect-5.26.4
David Edmundson 2021-01-21 11:57:37 +00:00
parent a0c7f997d4
commit e6eee5f970
1 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,8 @@ void KeyboardLayout::notifyLayoutChange()
}
static const QString s_keyboardService = QStringLiteral("org.kde.keyboard");
// this exists because in Plasma 5.21 we want to use a new applet for wayland, but still have the legacy system in use on X11
static const QString s_keyboardService_appletTrigger = QStringLiteral("org.kde.keyboard.wayland");
static const QString s_keyboardObject = QStringLiteral("/Layouts");
KeyboardLayoutDBusInterface::KeyboardLayoutDBusInterface(Xkb *xkb, const KConfigGroup &configGroup, KeyboardLayout *parent)
@ -190,11 +192,13 @@ KeyboardLayoutDBusInterface::KeyboardLayoutDBusInterface(Xkb *xkb, const KConfig
QDBusConnection::sessionBus().registerObject(s_keyboardObject, this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals);
QDBusConnection::sessionBus().registerService(s_keyboardService);
QDBusConnection::sessionBus().registerService(s_keyboardService_appletTrigger);
}
KeyboardLayoutDBusInterface::~KeyboardLayoutDBusInterface()
{
QDBusConnection::sessionBus().unregisterService(s_keyboardService);
QDBusConnection::sessionBus().unregisterService(s_keyboardService_appletTrigger);
}
void KeyboardLayoutDBusInterface::switchToNextLayout()