Merge into jb-mr1-dev

Change-Id: I97ff2551b36a1b590f2d314cabfcf198dd10f404
This commit is contained in:
Jean-Baptiste Queru
2012-09-25 09:35:16 -07:00
3 changed files with 25 additions and 17 deletions

View File

@@ -456,11 +456,12 @@ public class SurfaceView extends View {
}
if (mWindow == null) {
Display display = getDisplay();
mWindow = new MyWindow(this);
mLayout.type = mWindowType;
mLayout.gravity = Gravity.START|Gravity.TOP;
mSession.addToDisplayWithoutInputChannel(mWindow, mWindow.mSeq, mLayout,
mVisible ? VISIBLE : GONE, Display.DEFAULT_DISPLAY, mContentInsets);
mVisible ? VISIBLE : GONE, display.getDisplayId(), mContentInsets);
}
boolean realSizeChanged;

View File

@@ -280,7 +280,8 @@ final class Session extends IWindowSession.Stub
// !!! FIXME: put all this heavy stuff onto the mH looper, as well as
// the actual drag event dispatch stuff in the dragstate
mService.mDragState.register(callingWin.mDisplayContent.getDisplay());
Display display = callingWin.mDisplayContent.getDisplay();
mService.mDragState.register(display);
mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
if (!mService.mInputManager.transferTouchFocus(callingWin.mInputChannel,
mService.mDragState.mServerChannel)) {
@@ -310,6 +311,7 @@ final class Session extends IWindowSession.Stub
touchY - thumbCenterY);
surface.setAlpha(.7071f);
surface.setLayer(mService.mDragState.getDragLayerLw());
surface.setLayerStack(display.getLayerStack());
surface.show();
} finally {
Surface.closeTransaction();

View File

@@ -9777,7 +9777,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (moveInputMethodWindowsIfNeededLocked(
mode != UPDATE_FOCUS_WILL_ASSIGN_LAYERS &&
mode != UPDATE_FOCUS_WILL_PLACE_SURFACES)) {
getDefaultDisplayContentLocked().layoutNeeded = true;
displayContent.layoutNeeded = true;
}
if (mode == UPDATE_FOCUS_PLACING_SURFACES) {
performLayoutLockedInner(displayContent, true /*initial*/, updateInputWindows);
@@ -9791,7 +9791,7 @@ public class WindowManagerService extends IWindowManager.Stub
if ((focusChanged & WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT) != 0) {
// The change in focus caused us to need to do a layout. Okay.
getDefaultDisplayContentLocked().layoutNeeded = true;
displayContent.layoutNeeded = true;
if (mode == UPDATE_FOCUS_PLACING_SURFACES) {
performLayoutLockedInner(displayContent, true /*initial*/, updateInputWindows);
}
@@ -9814,22 +9814,29 @@ public class WindowManagerService extends IWindowManager.Stub
}
private WindowState computeFocusedWindowLocked() {
WindowState result = null;
WindowState win;
if (mAnimator.mUniverseBackground != null
&& mAnimator.mUniverseBackground.mWin.canReceiveKeys()) {
return mAnimator.mUniverseBackground.mWin;
}
int nextAppIndex = mAppTokens.size()-1;
WindowToken nextApp = nextAppIndex >= 0
? mAppTokens.get(nextAppIndex) : null;
final int displayCount = mDisplayContents.size();
for (int i = 0; i < displayCount; i++) {
final DisplayContent displayContent = mDisplayContents.valueAt(i);
WindowState win = findFocusedWindowLocked(displayContent);
if (win != null) {
return win;
}
}
return null;
}
// TODO(multidisplay): IMEs are only supported on the default display.
WindowList windows = getDefaultWindowListLocked();
private WindowState findFocusedWindowLocked(DisplayContent displayContent) {
int nextAppIndex = mAppTokens.size()-1;
WindowToken nextApp = nextAppIndex >= 0 ? mAppTokens.get(nextAppIndex) : null;
final WindowList windows = displayContent.getWindowList();
for (int i = windows.size() - 1; i >= 0; i--) {
win = windows.get(i);
final WindowState win = windows.get(i);
if (localLOGV || DEBUG_FOCUS) Slog.v(
TAG, "Looking for focus: " + i
@@ -9879,12 +9886,10 @@ public class WindowManagerService extends IWindowManager.Stub
if (win.canReceiveKeys()) {
if (DEBUG_FOCUS) Slog.v(
TAG, "Found focus @ " + i + " = " + win);
result = win;
break;
return win;
}
}
return result;
return null;
}
private void startFreezingDisplayLocked(boolean inTransaction,