wayland: Reload key-repeat settings when kcminputrc changes
At the moment, if key repeat settings are changed in the input kcm, kwin will do nothing.
This commit is contained in:
parent
2da1b3211e
commit
d96eb3897d
2 changed files with 18 additions and 4 deletions
17
input.cpp
17
input.cpp
|
@ -2092,7 +2092,6 @@ void InputRedirection::setupWorkspace()
|
|||
);
|
||||
}
|
||||
);
|
||||
connect(workspace(), &Workspace::configChanged, this, &InputRedirection::reconfigure);
|
||||
|
||||
m_keyboard->init();
|
||||
m_pointer->init();
|
||||
|
@ -2148,11 +2147,17 @@ void InputRedirection::setupInputFilters()
|
|||
}
|
||||
}
|
||||
|
||||
void InputRedirection::handleInputConfigChanged(const KConfigGroup &group)
|
||||
{
|
||||
if (group.name() == QLatin1String("Keyboard")) {
|
||||
reconfigure();
|
||||
}
|
||||
}
|
||||
|
||||
void InputRedirection::reconfigure()
|
||||
{
|
||||
if (Application::usesLibinput()) {
|
||||
auto inputConfig = InputConfig::self()->inputConfig();
|
||||
inputConfig->reparseConfiguration();
|
||||
auto inputConfig = m_inputConfigWatcher->config();
|
||||
const auto config = inputConfig->group(QStringLiteral("Keyboard"));
|
||||
const int delay = config.readEntry("RepeatDelay", 660);
|
||||
const int rate = config.readEntry("RepeatRate", 25);
|
||||
|
@ -2293,10 +2298,14 @@ void InputRedirection::setupLibInput()
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
m_inputConfigWatcher = KConfigWatcher::create(InputConfig::self()->inputConfig());
|
||||
connect(m_inputConfigWatcher.data(), &KConfigWatcher::configChanged,
|
||||
this, &InputRedirection::handleInputConfigChanged);
|
||||
reconfigure();
|
||||
}
|
||||
|
||||
setupTouchpadShortcuts();
|
||||
reconfigure();
|
||||
}
|
||||
|
||||
void InputRedirection::setupTouchpadShortcuts()
|
||||
|
|
5
input.h
5
input.h
|
@ -17,6 +17,7 @@
|
|||
#include <QPointer>
|
||||
#include <config-kwin.h>
|
||||
|
||||
#include <KConfigWatcher>
|
||||
#include <KSharedConfig>
|
||||
#include <QSet>
|
||||
|
||||
|
@ -296,6 +297,9 @@ Q_SIGNALS:
|
|||
void hasAlphaNumericKeyboardChanged(bool set);
|
||||
void hasTabletModeSwitchChanged(bool set);
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleInputConfigChanged(const KConfigGroup &group);
|
||||
|
||||
private:
|
||||
void setupLibInput();
|
||||
void setupTouchpadShortcuts();
|
||||
|
@ -318,6 +322,7 @@ private:
|
|||
|
||||
QVector<InputEventFilter*> m_filters;
|
||||
QVector<InputEventSpy*> m_spies;
|
||||
KConfigWatcher::Ptr m_inputConfigWatcher;
|
||||
|
||||
KWIN_SINGLETON(InputRedirection)
|
||||
friend InputRedirection *input();
|
||||
|
|
Loading…
Reference in a new issue