inputmethod: Remove the SNI entirely

It can be replaced with an ad-hoc plasmoid that gets to be a bit more
specific and interactive.
This commit is contained in:
Aleix Pol 2021-07-22 20:09:01 +02:00 committed by David Edmundson
parent ad4f183a76
commit 1473466ef7
2 changed files with 0 additions and 47 deletions

View file

@ -73,10 +73,6 @@ void InputMethod::init()
});
connect(ScreenLockerWatcher::self(), &ScreenLockerWatcher::aboutToLock, this, &InputMethod::hide);
updateSni();
connect(this, &InputMethod::enabledChanged, this, &InputMethod::updateSni);
new VirtualKeyboardDBus(this);
qCDebug(KWIN_VIRTUALKEYBOARD) << "Registering the DBus interface";
@ -509,46 +505,6 @@ void InputMethod::adoptInputMethodContext()
connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keyboardGrabRequested, this, &InputMethod::installKeyboardGrab, Qt::UniqueConnection);
}
void InputMethod::updateSni()
{
if (m_inputMethodCommand.isEmpty()) {
m_sni.reset();
return;
}
if (!m_sni) {
qCDebug(KWIN_VIRTUALKEYBOARD) << "Registering the SNI";
m_sni.reset(new KStatusNotifierItem(QStringLiteral("kwin-virtual-keyboard"), this));
connect(m_sni.get(), &KStatusNotifierItem::activateRequested, this,
[this] {
setEnabled(!m_enabled);
}
);
QMenu *sniMenu = new QMenu;
sniMenu->addAction(i18n("Configure virtual keyboards..."), this, [] {
QProcess::startDetached("systemsettings5", {"kcm_virtualkeyboard"});
});
m_sni->setContextMenu(sniMenu);
}
m_sni->setStandardActionsEnabled(false);
m_sni->setCategory(KStatusNotifierItem::Hardware);
m_sni->setStatus(KStatusNotifierItem::Passive);
m_sni->setTitle(i18n("Virtual Keyboard"));
m_sni->setToolTipTitle(i18n("Whether to show the virtual keyboard on demand."));
if (m_enabled) {
m_sni->setIconByName(QStringLiteral("input-keyboard-virtual-on"));
m_sni->setTitle(i18n("Virtual Keyboard: enabled"));
m_sni->setOverlayIconByName({});
} else {
m_sni->setIconByName(QStringLiteral("input-keyboard-virtual-off"));
m_sni->setTitle(i18n("Virtual Keyboard: disabled"));
m_sni->setOverlayIconByName({});
}
}
void InputMethod::updateInputPanelState()
{
if (!waylandServer()) {
@ -585,7 +541,6 @@ void InputMethod::setInputMethodCommand(const QString &command)
if (m_enabled) {
startInputMethod();
}
updateSni();
Q_EMIT availableChanged();
}

View file

@ -81,7 +81,6 @@ private Q_SLOTS:
void modifiers(quint32 serial, quint32 mods_depressed, quint32 mods_latched, quint32 mods_locked, quint32 group);
private:
void updateSni();
void updateInputPanelState();
void adoptInputMethodContext();
void commitString(qint32 serial, const QString &text);
@ -103,7 +102,6 @@ private:
bool m_enabled = true;
quint32 m_serial = 0;
QScopedPointer<KStatusNotifierItem> m_sni;
QPointer<InputPanelV1Client> m_inputClient;
QPointer<AbstractClient> m_trackedClient;