Merge "Make sure to clear previous display's last focus window when reparenting task" into qt-qpr1-dev

This commit is contained in:
TreeHugger Robot
2019-09-11 19:52:06 +00:00
committed by Android (Google) Code Review

View File

@@ -1072,9 +1072,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
// removing from parent.
token.getParent().removeChild(token);
}
if (prevDc.mLastFocus == mCurrentFocus) {
// The window has become the focus of this display, so it should not be notified
// that it lost focus from the previous display.
if (token.hasChild(prevDc.mLastFocus)) {
// If the reparent window token contains previous display's last focus window, means
// it will end up to gain window focus on the target display, so it should not be
// notified that it lost focus from the previous display.
prevDc.mLastFocus = null;
}
}