Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1afd975 authored by Aayush Gupta's avatar Aayush Gupta Committed by Michael Bestas
Browse files

RichInputConnection: Force batch edit restart when querying text near cursor



Issue: calyxos#2916
Change-Id: I7daad9ab62f87d4dcff02f0993b33a85a815896f
Signed-off-by: default avatarAayush Gupta <aayushgupta219@gmail.com>
parent a27d7edd
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -705,6 +705,15 @@ public final class RichInputConnection implements PrivateCommandPerformer {
        if (!isConnected()) {
        if (!isConnected()) {
            return null;
            return null;
        }
        }

        // Restart batch edit to force state update for broken web apps (for e.g. ProtonMail)
        // as batch edit mode avoids sending state updates until batch edit end.
        // See beginBatchEdit mode documentation for further information.
        if (mNestLevel > 0) {
            endBatchEdit();
            beginBatchEdit();
        }

        final CharSequence before = getTextBeforeCursorAndDetectLaggyConnection(
        final CharSequence before = getTextBeforeCursorAndDetectLaggyConnection(
                OPERATION_GET_WORD_RANGE_AT_CURSOR,
                OPERATION_GET_WORD_RANGE_AT_CURSOR,
                SLOW_INPUT_CONNECTION_ON_PARTIAL_RELOAD_MS,
                SLOW_INPUT_CONNECTION_ON_PARTIAL_RELOAD_MS,