TextEdit: Avoid scrolling to cursor during app switch on GNOME
GNOME sends empty InputMethod event when switching applications with Alt-Tab. As long as this event is empty, we don't need to scroll to cursor, because we're not adding any input text to it. This also fixes "out of scope" bug QTCREATORBUG-26628 Fixes: QTBUG-100039 Task-number: QTCREATORBUG-26628 Change-Id: I3ccfea50ae52f6f0cbf82c29f07944894050e7dd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 8b3f2dd994619fd224f54e59b7803d3e7d5896b6)
This commit is contained in:
parent
b5982616bd
commit
567d047c4e
@ -2214,6 +2214,10 @@ void QPlainTextEdit::inputMethodEvent(QInputMethodEvent *e)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
d->sendControlEvent(e);
|
d->sendControlEvent(e);
|
||||||
|
const bool emptyEvent = e->preeditString().isEmpty() && e->commitString().isEmpty()
|
||||||
|
&& e->attributes().isEmpty();
|
||||||
|
if (emptyEvent)
|
||||||
|
return;
|
||||||
ensureCursorVisible();
|
ensureCursorVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1808,6 +1808,10 @@ void QTextEdit::inputMethodEvent(QInputMethodEvent *e)
|
|||||||
setEditFocus(true);
|
setEditFocus(true);
|
||||||
#endif
|
#endif
|
||||||
d->sendControlEvent(e);
|
d->sendControlEvent(e);
|
||||||
|
const bool emptyEvent = e->preeditString().isEmpty() && e->commitString().isEmpty()
|
||||||
|
&& e->attributes().isEmpty();
|
||||||
|
if (emptyEvent)
|
||||||
|
return;
|
||||||
ensureCursorVisible();
|
ensureCursorVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user