diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4bec2117a..c3b6d7ab8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -498,6 +498,7 @@ set(kwin_KDE_LIBS
KF5::ConfigWidgets
KF5::Crash
KF5::GlobalAccel
+ KF5::GlobalAccelPrivate
KF5::I18n
KF5::Notifications
KF5::Service
diff --git a/globalshortcuts.cpp b/globalshortcuts.cpp
index 8d4a491eb2..0fafac3af0 100644
--- a/globalshortcuts.cpp
+++ b/globalshortcuts.cpp
@@ -21,9 +21,12 @@ along with this program. If not, see .
#include "globalshortcuts.h"
// kwin
#include
+#include "main.h"
+#include "utils.h"
// KDE
#include
#include
+#include
// Qt
#include
@@ -91,6 +94,16 @@ GlobalShortcutsManager::GlobalShortcutsManager(QObject *parent)
: QObject(parent)
, m_config(KSharedConfig::openConfig(QStringLiteral("kglobalshortcutsrc"), KConfig::SimpleConfig))
{
+ if (kwinApp()->shouldUseWaylandForCompositing()) {
+ m_kglobalAccel = new KGlobalAccelD(this);
+ if (!m_kglobalAccel->init()) {
+ qCDebug(KWIN_CORE) << "Init of kglobalaccel failed";
+ delete m_kglobalAccel;
+ m_kglobalAccel = nullptr;
+ } else {
+ qCDebug(KWIN_CORE) << "KGlobalAcceld inited";
+ }
+ }
}
template
diff --git a/globalshortcuts.h b/globalshortcuts.h
index 30dfa0d3e4..fa7a89580c 100644
--- a/globalshortcuts.h
+++ b/globalshortcuts.h
@@ -27,6 +27,7 @@ along with this program. If not, see .
#include
class QAction;
+class KGlobalAccelD;
namespace KWin
{
@@ -104,6 +105,7 @@ private:
QHash > m_pointerShortcuts;
QHash > m_axisShortcuts;
KSharedConfigPtr m_config;
+ KGlobalAccelD *m_kglobalAccel = nullptr;
};
class GlobalShortcut