}
mTouchExcludeRegion.op(mTmpRect, Region.Op.DIFFERENCE);
}
- if (task.isDockedInEffect() && !task.isResizeable()) {
+ if (task.isTwoFingerScrollMode()) {
stack.getBounds(mTmpRect);
mNonResizeableRegion.op(mTmpRect, Region.Op.UNION);
break;
return inDockedWorkspace() || isResizeableByDockedStack();
}
+ boolean isTwoFingerScrollMode() {
+ return isDockedInEffect() && !isResizeable();
+ }
+
WindowState getTopVisibleAppMainWindow() {
final AppWindowToken token = getTopVisibleAppToken();
return token != null ? token.findMainWindow() : null;
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.
}
}
+ // 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);
}
}
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) {