diff options
| author | 2019-06-03 21:50:55 +0800 | |
|---|---|---|
| committer | 2019-06-03 14:20:00 +0000 | |
| commit | 0683fe791e810d576584fab816f99eac51f9cff7 (patch) | |
| tree | dce24ef0f659a24422cfffe26b8f10b2cb10743e | |
| parent | 959de31e42dbe3a5cc348fc74735bacd8b5dd5d9 (diff) | |
Refine onPointerDownOutsideFocus
The original logic would send onPointerDownOutsideFocus to WindowManager
if a non-focused window is getting touched. And then, WindowManager will
move the display to the top. However, when per-display focus is enabled,
touching on a non-top focused window won't make the display to be moved
to the top. This makes the window cannot receive display-unspecified key
events, and also break some CTS.
This CL would send onPointerDownOutsideFocus if a window is getting
touched, as long as it is not the focused window on the focused display.
Fix: 134157810
Fix: 133323637
Test: atest ActivityLifecycleTopResumedStateTests WindowFocusTests
Change-Id: Ifa42ba766f58ec77e99f67080fd541284bb23c82
| -rw-r--r-- | services/inputflinger/InputDispatcher.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp index 31a2dab6c5..c2ff4c9629 100644 --- a/services/inputflinger/InputDispatcher.cpp +++ b/services/inputflinger/InputDispatcher.cpp @@ -2172,9 +2172,8 @@ void InputDispatcher::dispatchPointerDownOutsideFocus(uint32_t source, int32_t a return; } - int32_t displayId = inputWindowHandle->getInfo()->displayId; sp<InputWindowHandle> focusedWindowHandle = - getValueByKey(mFocusedWindowHandlesByDisplay, displayId); + getValueByKey(mFocusedWindowHandlesByDisplay, mFocusedDisplayId); bool hasFocusChanged = !focusedWindowHandle || focusedWindowHandle->getToken() != newToken; |