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

Commit 912d9197 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Add input method to the tap detection exclude area.

Without this touch events on the input method will trigger focus change
if there is a window underneath the input. When focus changes, the input
method will go away too.

Bug: 25930832
Change-Id: I532cb9e78f6fe37b1ddfada75594fc695898a090
parent 9a3f84ce
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -94,8 +94,9 @@ class DisplayContent {
    Region mNonResizeableRegion = new Region();

    /** Save allocating when calculating rects */
    private Rect mTmpRect = new Rect();
    private Rect mTmpRect2 = new Rect();
    private final Rect mTmpRect = new Rect();
    private final Rect mTmpRect2 = new Rect();
    private final Region mTmpRegion = new Region();

    /** For gathering Task objects in order. */
    final ArrayList<Task> mTmpTaskHistory = new ArrayList<Task>();
@@ -403,6 +404,14 @@ class DisplayContent {
        if (addBackFocusedTask) {
            mTouchExcludeRegion.op(mTmpRect2, Region.Op.UNION);
        }
        final WindowState inputMethod = mService.mInputMethodWindow;
        if (inputMethod != null && inputMethod.isVisibleLw()) {
            // If the input method is visible and the user is typing, we don't want these touch
            // events to be intercepted and used to change focus. This would likely cause a
            // disappearance of the input method.
            inputMethod.getTouchableRegion(mTmpRegion);
            mTouchExcludeRegion.op(mTmpRegion, Region.Op.UNION);
        }
        if (mTapDetector != null) {
            mTapDetector.setTouchExcludeRegion(mTouchExcludeRegion, mNonResizeableRegion);
        }