Commit e457ceb7 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

FormLineEdit: Don't run focusin action when gaining focus because of window management

Adobe Reader doesn't do it, and with reason, because otherwise we end up
with:
 * Run focus in script
 * script shows alert()
 * field loses focus and gains it again once the alert() is closed
 * infinite loop

BUGS: 436990
parent b518c01f
Pipeline #64273 passed with stage
in 26 minutes and 6 seconds
......@@ -483,8 +483,12 @@ bool FormLineEdit::event(QEvent *e)
if (text() != fft->text())
setText(fft->text());
m_editing = true;
if (const Okular::Action *action = m_ff->additionalAction(Okular::Annotation::FocusIn))
emit m_controller->focusAction(action, fft);
QFocusEvent *focusEvent = static_cast<QFocusEvent *>(e);
if (focusEvent->reason() != Qt::ActiveWindowFocusReason) {
if (const Okular::Action *action = m_ff->additionalAction(Okular::Annotation::FocusIn))
emit m_controller->focusAction(action, fft);
}
setFocus();
} else if (e->type() == QEvent::FocusOut) {
m_editing = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment