inputmethod: Don't disable them by default if there's a connected keyboard

If the user has chosen to have a virtual keyboard (i.e. prefered maliit
over none in the KCM) they should get it. If it's too annoying it should
either be disabled or we can fix it so it gets less in the way.

This is especially important since some hardware registers itself as a
keyboard even if it's not a fully functional keyboard.
This commit is contained in:
Aleix Pol 2021-06-02 16:38:36 +02:00 committed by Aleix Pol Gonzalez
parent 4a16e18808
commit 74724065ae
2 changed files with 1 additions and 12 deletions

View file

@ -70,17 +70,6 @@ void InputMethod::init()
});
connect(ScreenLockerWatcher::self(), &ScreenLockerWatcher::aboutToLock, this, &InputMethod::hide);
if (waylandServer()) {
m_enabled = !input()->hasAlphaNumericKeyboard();
qCDebug(KWIN_VIRTUALKEYBOARD) << "enabled by default: " << m_enabled;
connect(input(), &InputRedirection::hasAlphaNumericKeyboardChanged, this,
[this] (bool set) {
qCDebug(KWIN_VIRTUALKEYBOARD) << "AlphaNumeric Keyboard changed:" << set << "toggling virtual keyboard.";
setEnabled(!set);
}
);
}
updateSni();
connect(this, &InputMethod::enabledChanged, this, &InputMethod::updateSni);

View file

@ -88,7 +88,7 @@ private:
quint32 end = 0;
} preedit;
bool m_enabled = false;
bool m_enabled = true;
quint32 m_serial = 0;
QScopedPointer<KStatusNotifierItem> m_sni;
QPointer<AbstractClient> m_inputClient;