diff options
| author | 2017-05-04 14:05:59 +0200 | |
|---|---|---|
| committer | 2017-05-05 14:58:35 +0200 | |
| commit | 70f59488d73665730f06860d40dd380602399a8f (patch) | |
| tree | 9139a1681dac56f78ce5371c4afe70a88a6a92f0 | |
| parent | eb59d6e9d6f652a9e77d4190b52ef4c4f1b9f438 (diff) | |
Fix bounds calculation
Don't include the wallpaper window when calculating the frame
in multi-window.
Test: Go multi-window, go recents.
Change-Id: I8b4fb48767d6bdbda055d9c631811ad5a1dcaee6
Fixes: 36240988
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index b27d6c4b657a..92d26cbf92ec 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -2948,27 +2948,29 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } // Don't include wallpaper in bounds calculation - if (!mutableIncludeFullDisplay.value && includeDecor) { - final TaskStack stack = w.getStack(); - if (stack != null) { - stack.getBounds(frame); - } + if (!w.mIsWallpaper && !mutableIncludeFullDisplay.value) { + if (includeDecor) { + final TaskStack stack = w.getStack(); + if (stack != null) { + stack.getBounds(frame); + } - // We want to screenshot with the exact bounds of the surface of the app. Thus, - // intersect it with the frame. - frame.intersect(w.mFrame); - }else if (!mutableIncludeFullDisplay.value && !w.mIsWallpaper) { - final Rect wf = w.mFrame; - final Rect cr = w.mContentInsets; - int left = wf.left + cr.left; - int top = wf.top + cr.top; - int right = wf.right - cr.right; - int bottom = wf.bottom - cr.bottom; - frame.union(left, top, right, bottom); - w.getVisibleBounds(stackBounds); - if (!Rect.intersects(frame, stackBounds)) { - // Set frame empty if there's no intersection. - frame.setEmpty(); + // We want to screenshot with the exact bounds of the surface of the app. Thus, + // intersect it with the frame. + frame.intersect(w.mFrame); + } else { + final Rect wf = w.mFrame; + final Rect cr = w.mContentInsets; + int left = wf.left + cr.left; + int top = wf.top + cr.top; + int right = wf.right - cr.right; + int bottom = wf.bottom - cr.bottom; + frame.union(left, top, right, bottom); + w.getVisibleBounds(stackBounds); + if (!Rect.intersects(frame, stackBounds)) { + // Set frame empty if there's no intersection. + frame.setEmpty(); + } } } |