summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2015-09-18 15:14:59 -0700
committer Wale Ogunwale <ogunwale@google.com> 2015-09-18 15:34:05 -0700
commit2b19b6046cd7273ddd2818a2fbb8d3f0eaaa623a (patch)
tree7ce62051eaf58008766ee746ee5181ac3bf8d9e3
parent153a2930e3da91d47a51dca0802700d838de55a7 (diff)
Don't set input bounds for task to the stack bounds.
3b2658011819cfe1bed61763bb666bde6e919f79 tried to fix a problem where the task could be dragged outside its stack bounds. However, the input bounds was been set to the entire stack bounds which prevented input from going to other tasks in the stack. We now intersect with the stack bounds. Bug: 24201913 Change-Id: Ibb84bc099b6709ceb865f114b5e9857c5ab2ef1a
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java30
1 files changed, 20 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index fa28eba14603..16347f560e64 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -16,7 +16,6 @@
package com.android.server.wm;
-import static android.app.ActivityManager.FREEFORM_WORKSPACE_STACK_ID;
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
@@ -382,6 +381,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
*/
PowerManager.WakeLock mDrawLock;
+ final private Rect mTmpRect = new Rect();
+
WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token,
WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
int viewVisibility, final DisplayContent displayContent) {
@@ -937,24 +938,33 @@ final class WindowState implements WindowManagerPolicy.WindowState {
* bounds will be returned.
*/
void getVisibleBounds(Rect bounds, boolean forTouch) {
- final boolean useStackBounds = mAppToken != null && mAppToken.mCropWindowsToStack;
+ boolean intersectWithStackBounds = mAppToken != null && mAppToken.mCropWindowsToStack;
boolean isFreeform = false;
bounds.setEmpty();
- if (useStackBounds) {
+ mTmpRect.setEmpty();
+ if (intersectWithStackBounds) {
final TaskStack stack = getStack();
if (stack != null) {
- stack.getBounds(bounds);
- isFreeform = stack.mStackId == FREEFORM_WORKSPACE_STACK_ID;
+ stack.getBounds(mTmpRect);
+ } else {
+ intersectWithStackBounds = false;
}
- } else {
- final Task task = getTask();
- if (task != null) {
- task.getBounds(bounds);
- isFreeform = task.inFreeformWorkspace();
+ }
+
+ final Task task = getTask();
+ if (task != null) {
+ task.getBounds(bounds);
+ isFreeform = task.inFreeformWorkspace();
+ if (intersectWithStackBounds) {
+ bounds.intersect(mTmpRect);
}
}
+
if (bounds.isEmpty()) {
bounds.set(mFrame);
+ if (intersectWithStackBounds) {
+ bounds.intersect(mTmpRect);
+ }
return;
}
if (forTouch && isFreeform) {