Hide ibus IM on password fields

We haven't hooked on any of the properties to tell ibus IMs the type of
field or that it should be hidden, so hide it like is standard.

Change-Id: Iaa64c669f7162b60c16971ec962101b974108e65
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2017-09-15 12:42:55 +02:00
parent 4e30001e5f
commit 6c4a1914e0
2 changed files with 12 additions and 0 deletions

View File

@ -136,6 +136,17 @@ bool QIBusPlatformInputContext::isValid() const
return d->valid && d->busConnected;
}
bool QIBusPlatformInputContext::hasCapability(Capability capability) const
{
switch (capability) {
case QPlatformInputContext::HiddenTextCapability:
return false; // QTBUG-40691, do not show IME on desktop for password entry fields.
default:
break;
}
return true;
}
void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int)
{
if (!d->busConnected)

View File

@ -95,6 +95,7 @@ public:
void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE;
bool filterEvent(const QEvent *event) Q_DECL_OVERRIDE;
QLocale locale() const Q_DECL_OVERRIDE;
bool hasCapability(Capability capability) const Q_DECL_OVERRIDE;
public Q_SLOTS:
void commitText(const QDBusVariant &text);