Add global shortcuts support on MATE

This commit is contained in:
Jonas Kvinge
2021-05-29 20:35:55 +02:00
parent 0c5236ebcb
commit 1ced4e277b
15 changed files with 386 additions and 77 deletions

View File

@@ -43,6 +43,12 @@ const char *GlobalShortcutsBackendKDE::kKdePath = "/kglobalaccel";
GlobalShortcutsBackendKDE::GlobalShortcutsBackendKDE(GlobalShortcutsManager *parent) : GlobalShortcutsBackend(parent), interface_(nullptr), component_(nullptr) {}
bool GlobalShortcutsBackendKDE::IsAvailable() {
return QDBusConnection::sessionBus().interface()->isServiceRegistered(kKdeService);
}
bool GlobalShortcutsBackendKDE::DoRegister() {
qLog(Debug) << "Registering";
@@ -92,7 +98,7 @@ void GlobalShortcutsBackendKDE::RegisterFinished(QDBusPendingCallWatcher *watche
QObject::connect(component_, &org::kde::kglobalaccel::Component::globalShortcutPressed, this, &GlobalShortcutsBackendKDE::GlobalShortcutPressed, Qt::UniqueConnection);
qLog(Debug) << "Registered";
qLog(Debug) << "registered.";
}