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

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

Fix bug 3210201 - Popup window wrong size/position when IME hidden

Fixes a case where ViewRoot does not recompute its size properly.
This caused various offsets to get out of sync and the window would
draw improperly.

Change-Id: Id0abb37bbf27b60de2dca4077c21040ec84ef163
parent 300ed2cd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -865,6 +865,9 @@ public final class ViewRoot extends Handler implements ViewParent,
                childWidthMeasureSpec = getRootMeasureSpec(desiredWindowWidth, lp.width);
                childHeightMeasureSpec = getRootMeasureSpec(desiredWindowHeight, lp.height);
                host.measure(childWidthMeasureSpec, childHeightMeasureSpec);
                if (mWidth != host.getMeasuredWidth() || mHeight != host.getMeasuredHeight()) {
                    windowSizeMayChange = true;
                }
            }

            if (DBG) {
+4 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On
        }

        mPopup.setContentWidth(Math.min(measureContentWidth(adapter), mPopupMaxWidth));
        mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
        mPopup.show();
        mPopup.getListView().setOnKeyListener(this);
    }
@@ -163,6 +164,9 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On
            final View anchor = mAnchorView != null ? mAnchorView.get() : null;
            if (anchor != null && !anchor.isShown()) {
                dismiss();
            } else {
                // Recompute window size and position
                mPopup.show();
            }
        }
    }