Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec199613 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru
Browse files

Merge into jb-mr1-dev

Change-Id: I97ff2551b36a1b590f2d314cabfcf198dd10f404
parents 7a7c6aa0 8d0243a3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
+3 −1
Original line number Diff line number Diff line
@@ -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();
+19 −14
Original line number Diff line number Diff line
@@ -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;
        }

        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;
    }

    private WindowState findFocusedWindowLocked(DisplayContent displayContent) {
        int nextAppIndex = mAppTokens.size()-1;
        WindowToken nextApp = nextAppIndex >= 0
            ? mAppTokens.get(nextAppIndex) : null;
        WindowToken nextApp = nextAppIndex >= 0 ? mAppTokens.get(nextAppIndex) : null;

        // TODO(multidisplay): IMEs are only supported on the default display.
        WindowList windows = getDefaultWindowListLocked();
        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,