From 5e5645e860048bcdfef5db01b936e73357174caf Mon Sep 17 00:00:00 2001 From: Linnan Li Date: Tue, 5 Mar 2024 14:43:05 +0000 Subject: Move occlusion detection into logical space Same as our "hit test" to find the target window, since WM works in logical space, we consider the window's frame to be (l, t, r, b), and the portion of the window that can be occluded in the x-direction is [l, r), and the portion of the window that can be occluded in the y-direction is [t, b). When the logical space is different from the physical space, the opening and closing intervals in each of these directions will be inconsistent, leading to abnormal detection of the edge part. Here we move the occlusion detection to the logical space as well, consistent with the "hit test" for finding the target window. Bug: 327712879 Test: atest inputflinger_tests Test: Create a window that can cause occlusion and perform clicks on the edges, making sure that the occlusion range is x = [l, r), y = [t, b) under each direction of the screen. Signed-off-by: Linnan Li (cherry picked from https://partner-android-review.googlesource.com/q/commit:1a0060e9bcd25bee6ce7a9f5d01b9446b0c4d73b) Merged-In: I19b739bc8f1e48d8bc70020a2b07da227eaa6d8b Change-Id: I19b739bc8f1e48d8bc70020a2b07da227eaa6d8b --- libs/gui/WindowInfo.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'libs/gui/WindowInfo.cpp') diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp index 86bf0ee745..ad0d99d11e 100644 --- a/libs/gui/WindowInfo.cpp +++ b/libs/gui/WindowInfo.cpp @@ -73,14 +73,6 @@ void WindowInfo::addTouchableRegion(const Rect& region) { touchableRegion.orSelf(region); } -bool WindowInfo::touchableRegionContainsPoint(int32_t x, int32_t y) const { - return touchableRegion.contains(x, y); -} - -bool WindowInfo::frameContainsPoint(int32_t x, int32_t y) const { - return x >= frame.left && x < frame.right && y >= frame.top && y < frame.bottom; -} - bool WindowInfo::supportsSplitTouch() const { return !inputConfig.test(InputConfig::PREVENT_SPLITTING); } -- cgit v1.2.3-59-g8ed1b