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

Commit e423d38a authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Only hide ime leash for invisible ime control target

In case the ime target is still on screen after swiping to home.
Such as a top floating window with a text input field.

Bug: 335204769
Test: Returns from landscape app to portrait home by gesture
      while an overlay floating window is the ime target. The ime
      should still be visible after returning to home.
Change-Id: Ib653b6160d4c4dac7dc17f1b8298a0c3e5f2252f
parent ec1eac9a
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1554,11 +1554,14 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        // but InsetsStateController#notifyControlTargetChanged still waits for IME to redraw.
        // but InsetsStateController#notifyControlTargetChanged still waits for IME to redraw.
        final InsetsSourceProvider sourceProvider = imeWindow.getControllableInsetProvider();
        final InsetsSourceProvider sourceProvider = imeWindow.getControllableInsetProvider();
        if (sourceProvider == null || sourceProvider.mControl == null
        if (sourceProvider == null || sourceProvider.mControl == null
                || !sourceProvider.isClientVisible()
                || imeTarget == sourceProvider.getControlTarget()) {
                || imeTarget == sourceProvider.getControlTarget()) {
            return;
            return;
        }
        }
        final SurfaceControl imeInsetsLeash = sourceProvider.mControl.getLeash();
        final SurfaceControl imeInsetsLeash = sourceProvider.mControl.getLeash();
        if (imeInsetsLeash != null) {
        final InsetsControlTarget controlTarget = sourceProvider.getControlTarget();
        if (imeInsetsLeash != null && controlTarget != null && controlTarget.getWindow() != null
                && !controlTarget.getWindow().mToken.isVisible()) {
            dc.getSyncTransaction().reparent(imeInsetsLeash, null);
            dc.getSyncTransaction().reparent(imeInsetsLeash, null);
        }
        }
    }
    }