Forms: 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()
 * form loses focus and gains it again once the alert() is closed
 * infinite loop

The same fix we did in e457ceb731 but for
the rest of the widgets

BUGS: 472756
This commit is contained in:
Albert Astals Cid 2023-07-31 23:51:43 +02:00
parent bba7354818
commit f940ca1e2e

View file

@ -1220,7 +1220,7 @@ void SignatureEdit::signUnsignedSignature()
void FormClass::focusInEvent(QFocusEvent *event) \
{ \
Okular::Action *act = m_ff->additionalAction(Okular::Annotation::FocusIn); \
if (act) { \
if (act && event->reason() != Qt::ActiveWindowFocusReason) { \
m_controller->processScriptAction(act, m_ff, Okular::Annotation::FocusIn); \
} \
BaseClass::focusInEvent(event); \