mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 00:09:53 -05:00
Fix crash when toggling capslock rapidly
* Fix #5543 - Only check caps lock state when key is pressed/released or widget is focused.
This commit is contained in:
parent
a55bb39f20
commit
1ad9c1257b
@ -180,7 +180,9 @@ void PasswordEdit::autocompletePassword(const QString& password)
|
||||
|
||||
bool PasswordEdit::event(QEvent* event)
|
||||
{
|
||||
if (isVisible()) {
|
||||
if (isVisible()
|
||||
&& (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease
|
||||
|| event->type() == QEvent::FocusIn)) {
|
||||
checkCapslockState();
|
||||
}
|
||||
return QLineEdit::event(event);
|
||||
@ -204,7 +206,9 @@ void PasswordEdit::checkCapslockState()
|
||||
|
||||
if (newCapslockState) {
|
||||
QTimer::singleShot(
|
||||
150, [this]() { QToolTip::showText(mapToGlobal(rect().bottomLeft()), m_capslockAction->text()); });
|
||||
150, [this] { QToolTip::showText(mapToGlobal(rect().bottomLeft()), m_capslockAction->text()); });
|
||||
} else if (QToolTip::isVisible()) {
|
||||
QToolTip::hideText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user