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.
This commit is contained in:
Aleix Pol 2021-04-27 21:20:20 +02:00 committed by Aleix Pol Gonzalez
parent baa246fbb7
commit cadb13de0e
2 changed files with 4 additions and 4 deletions

View file

@ -4,3 +4,4 @@ Mutators=true
DefaultValueGetters=true
GenerateProperties=true
ParentInConstructor=true
Notifiers=true

View file

@ -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