Merge "Apply scroll to windows added to a non-resizeble task that's docked"

This commit is contained in:
Chong Zhang
2016-01-12 01:39:26 +00:00
committed by Android (Google) Code Review
5 changed files with 21 additions and 4 deletions

View File

@@ -393,7 +393,7 @@ class DisplayContent {
}
mTouchExcludeRegion.op(mTmpRect, Region.Op.DIFFERENCE);
}
if (task.isDockedInEffect() && !task.isResizeable()) {
if (task.isTwoFingerScrollMode()) {
stack.getBounds(mTmpRect);
mNonResizeableRegion.op(mTmpRect, Region.Op.UNION);
break;

View File

@@ -571,6 +571,10 @@ class Task implements DimLayer.DimLayerUser {
return inDockedWorkspace() || isResizeableByDockedStack();
}
boolean isTwoFingerScrollMode() {
return isDockedInEffect() && !isResizeable();
}
WindowState getTopVisibleAppMainWindow() {
final AppWindowToken token = getTopVisibleAppToken();
return token != null ? token.findMainWindow() : null;

View File

@@ -130,7 +130,7 @@ public class TaskStack implements DimLayer.DimLayerUser {
Configuration config = configs.get(task.mTaskId);
if (config != null) {
Rect bounds = taskBounds.get(task.mTaskId);
if (!task.isResizeable() && task.isDockedInEffect()) {
if (task.isTwoFingerScrollMode()) {
// This is a non-resizeable task that's docked (or side-by-side to the docked
// stack). It might have been scrolled previously, and after the stack resizing,
// it might no longer fully cover the stack area.

View File

@@ -1990,6 +1990,10 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
// If the window is being added to a task that's docked but non-resizeable,
// we need to update this new window's scroll position when it's added.
win.applyScrollIfNeeded();
if (type == TYPE_DOCK_DIVIDER) {
getDefaultDisplayContentLocked().getDockedDividerController().setWindow(win);
}

View File

@@ -1458,15 +1458,24 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
boolean inDockedWorkspace() {
Task task = getTask();
final Task task = getTask();
return task != null && task.inDockedWorkspace();
}
boolean isDockedInEffect() {
Task task = getTask();
final Task task = getTask();
return task != null && task.isDockedInEffect();
}
void applyScrollIfNeeded() {
final Task task = getTask();
if (task != null && task.isTwoFingerScrollMode()) {
task.getDimBounds(mTmpRect);
mXOffset = mTmpRect.left;
mYOffset = mTmpRect.top;
}
}
int getTouchableRegion(Region region, int flags) {
final boolean modal = (flags & (FLAG_NOT_TOUCH_MODAL | FLAG_NOT_FOCUSABLE)) == 0;
if (modal && mAppToken != null) {