From cadb13de0ea2e6240c858b8712fddc0def5d2830 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 27 Apr 2021 21:20:20 +0200 Subject: [PATCH] inputmethod: fix how we update to input method changes Properly notify about changes from the kcm and properly integrate them. So far it only worked between having and not having a keyboard. --- .../kwinvirtualkeyboard/virtualkeyboardsettings.kcfgc | 1 + src/main_wayland.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kcmkwin/kwinvirtualkeyboard/virtualkeyboardsettings.kcfgc b/src/kcmkwin/kwinvirtualkeyboard/virtualkeyboardsettings.kcfgc index 3a2d12c658..84247fc1b3 100644 --- a/src/kcmkwin/kwinvirtualkeyboard/virtualkeyboardsettings.kcfgc +++ b/src/kcmkwin/kwinvirtualkeyboard/virtualkeyboardsettings.kcfgc @@ -4,3 +4,4 @@ Mutators=true DefaultValueGetters=true GenerateProperties=true ParentInConstructor=true +Notifiers=true diff --git a/src/main_wayland.cpp b/src/main_wayland.cpp index 6916e519d7..93a182a162 100644 --- a/src/main_wayland.cpp +++ b/src/main_wayland.cpp @@ -216,7 +216,8 @@ void ApplicationWayland::refreshSettings(const KConfigGroup &group, const QByteA return; } - InputMethod::self()->setInputMethodCommand(group.readEntry("InputMethod", QString())); + KDesktopFile file(group.readEntry("InputMethod", QString())); + InputMethod::self()->setInputMethodCommand(file.desktopGroup().readEntry("Exec", QString())); } void ApplicationWayland::startSession() @@ -228,9 +229,7 @@ void ApplicationWayland::startSession() m_settingsWatcher = KConfigWatcher::create(kwinSettings); connect(m_settingsWatcher.data(), &KConfigWatcher::configChanged, this, &ApplicationWayland::refreshSettings); - KConfigGroup group = kwinSettings->group("Wayland"); - KDesktopFile file(group.readEntry("InputMethod", QString())); - InputMethod::self()->setInputMethodCommand(file.desktopGroup().readEntry("Exec", QString())); + refreshSettings(kwinSettings->group("Wayland"), {"InputMethod"}); } // start session