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

Commit e0b6cd14 authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 5386915 - Action mode is intercepting touches it shouldn't be

Standalone action mode windows should not be touch modal.

Change-Id: Ia3bab69b3ac344837093a17c4b58451bcc3471bf
parent a53d19dc
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ public class PopupWindow {
    private boolean mClipToScreen;
    private boolean mAllowScrollingAnchorParent = true;
    private boolean mLayoutInsetDecor = false;
    private boolean mNotTouchModal;

    private OnTouchListener mTouchInterceptor;
    
@@ -693,6 +694,15 @@ public class PopupWindow {
        return mWindowLayoutType;
    }

    /**
     * Set whether this window is touch modal or if outside touches will be sent to
     * other windows behind it.
     * @hide
     */
    public void setTouchModal(boolean touchModal) {
        mNotTouchModal = !touchModal;
    }

    /**
     * <p>Change the width and height measure specs that are given to the
     * window manager by the popup.  By default these are 0, meaning that
@@ -1048,6 +1058,9 @@ public class PopupWindow {
        if (mLayoutInsetDecor) {
            curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
        }
        if (mNotTouchModal) {
            curFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
        }
        return curFlags;
    }
    
+2 −0
Original line number Diff line number Diff line
@@ -2154,6 +2154,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                        mActionModePopup.setLayoutInScreenEnabled(true);
                        mActionModePopup.setLayoutInsetDecor(true);
                        mActionModePopup.setFocusable(true);
                        mActionModePopup.setOutsideTouchable(false);
                        mActionModePopup.setTouchModal(false);
                        mActionModePopup.setWindowLayoutType(
                                WindowManager.LayoutParams.TYPE_APPLICATION);
                        mActionModePopup.setContentView(mActionModeView);