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

FormLineEdit: Don't run focusout/formatfield actions when losing focus because of window management

Adobe Reader doesn't do it and if we do it can end up crashing because
we end up running two focusout actions in parallel and our script system
is not prepared for that:

Scenario:
 * Tab out of a field
 * Script for that focusout runs
 * focus goes to next field
 * script for that focusout shows an alert()
 * second focusout script for that field runs while the first is running
 * bad stuff

BUGS: 435833
parent 812adaa2
......@@ -491,7 +491,7 @@ bool FormLineEdit::event(QEvent *e)
// Don't worry about focus events from other sources than the user FocusEvent to edit the field
QFocusEvent *focusEvent = static_cast<QFocusEvent *>(e);
if (focusEvent->reason() == Qt::OtherFocusReason)
if (focusEvent->reason() == Qt::OtherFocusReason || focusEvent->reason() == Qt::ActiveWindowFocusReason)
return true;
if (const Okular::Action *action = m_ff->additionalAction(Okular::Annotation::FocusOut)) {
......
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