From 4d7c8ac372267bfaef132b11c2895a7aad584c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 22 Feb 2016 08:17:45 +0100 Subject: [PATCH] Connect to dbus signal reloadConfig from org.kde.keyboar /Layouts By connecting to the signal KWin can reload the keyboard layout configuration and adjust to changes in the configuration module. --- keyboard_input.cpp | 12 ++++++++++++ keyboard_input.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/keyboard_input.cpp b/keyboard_input.cpp index c1747f6860..57aa7b0dc0 100644 --- a/keyboard_input.cpp +++ b/keyboard_input.cpp @@ -387,6 +387,18 @@ void KeyboardInputRedirection::init() } ); + QDBusConnection::sessionBus().connect(QString(), + QStringLiteral("/Layouts"), + QStringLiteral("org.kde.keyboard"), + QStringLiteral("reloadConfig"), + this, + SLOT(reconfigure())); + + m_xkb->reconfigure(); +} + +void KeyboardInputRedirection::reconfigure() +{ m_xkb->reconfigure(); } diff --git a/keyboard_input.h b/keyboard_input.h index 85a5ce3e6d..dbb2865623 100644 --- a/keyboard_input.h +++ b/keyboard_input.h @@ -113,6 +113,9 @@ public: return m_xkb->modifiers(); } +private Q_SLOTS: + void reconfigure(); + private: InputRedirection *m_input; bool m_inited = false;