diff --git a/input.cpp b/input.cpp index 85d070b2e9..ea3161f311 100644 --- a/input.cpp +++ b/input.cpp @@ -293,6 +293,7 @@ InputRedirection::InputRedirection(QObject *parent) } #endif connect(kwinApp(), &Application::workspaceCreated, this, &InputRedirection::setupWorkspace); + reconfigure(); } InputRedirection::~InputRedirection() @@ -370,9 +371,24 @@ void InputRedirection::setupWorkspace() m_xkb->getGroup()); } ); + connect(workspace(), &Workspace::configChanged, this, &InputRedirection::reconfigure); } } +void InputRedirection::reconfigure() +{ +#if HAVE_INPUT + if (Application::usesLibinput()) { + const auto config = KSharedConfig::openConfig(QStringLiteral("kcminputrc"))->group(QStringLiteral("keyboard")); + const int delay = config.readEntry("RepeatDelay", 660); + const int rate = config.readEntry("RepeatRate", 25); + const bool enabled = config.readEntry("KeyboardRepeating", 0) == 0; + + waylandServer()->seat()->setKeyRepeatInfo(enabled ? rate : 0, delay); + } +#endif +} + static KWayland::Server::SeatInterface *findSeat() { auto server = waylandServer(); diff --git a/input.h b/input.h index 0ec266ba53..203e18d0ef 100644 --- a/input.h +++ b/input.h @@ -209,6 +209,7 @@ private: bool areButtonsPressed() const; void updateKeyboardWindow(); void setupWorkspace(); + void reconfigure(); QPointF m_globalPointer; QHash m_pointerButtons; QScopedPointer m_xkb;