summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2018-12-06 13:54:33 -0800
committer Vishnu Nair <vishnun@google.com> 2018-12-07 00:29:25 +0000
commit51625fa3f0663b5f12f0838a619c49a1bfc9533f (patch)
treefecb64e5e75b7de0e8b92c42bf137d91e94a2cca /services/surfaceflinger/Layer.cpp
parent5ea451005be4f8b1a91e3b2e8525e092b0515c49 (diff)
Input: Let WM compute touchable region 1/2
- For modal windows let WM define the touchable region. This fixes a regression introduced by ag/5700485 where input was sent to background windows. - When calculating input surface position, ignore the transparent region so that we do not incorrectly offset the input. This fixes and issue with input offset in AutoDesk drawing app. Bug: 120615996, 120612739, 120585467, 120604247 Test: Manual testing with apps listed in bugs. Automated tests to follow Change-Id: I906f1396ccc0c76f602a9903e696eedfc026f7c2
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d628995276..91be71e390 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -293,8 +293,10 @@ static FloatRect reduce(const FloatRect& win, const Region& exclude) {
return Region(Rect{win}).subtract(exclude).getBounds().toFloatRect();
}
-Rect Layer::computeScreenBounds() const {
- FloatRect bounds = computeBounds();
+Rect Layer::computeScreenBounds(bool reduceTransparentRegion) const {
+ const State& s(getDrawingState());
+ Region transparentRegion = reduceTransparentRegion ? getActiveTransparentRegion(s) : Region();
+ FloatRect bounds = computeBounds(transparentRegion);
ui::Transform t = getTransform();
// Transform to screen space.
bounds = t.transform(bounds);
@@ -2155,7 +2157,6 @@ InputWindowInfo Layer::fillInputInfo(const Rect& screenBounds) {
// Position the touchable region relative to frame screen location and restrict it to frame
// bounds.
info.touchableRegion = info.touchableRegion.translate(info.frameLeft, info.frameTop);
- info.touchableRegion = info.touchableRegion.intersect(frame);
info.visible = isVisible();
return info;
}