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

Commit 654386dd authored by Hiroki Sato's avatar Hiroki Sato
Browse files

Provide only caption and IME insets to freeform windows

System bars shouldn't provide insets to freeform windows. Currently,
gesture insets and tappable elements insets by system bars are provided
to freeform windows. These insets are attached to display, and intended
to be used for layouting fullscreen apps.

With this change, only caption insets and ime insets are given to
freeform windows.

Note that gesture and tappable insets from a caption bar are added in
InsetsState#processSource. Thus, this change doesn't affect it.

Bug: 234144193
Test: android.server.wm.WindowInsetsPolicyTest in freeform device
Change-Id: Ife41a37082a65db50c7bb5b75690db5bc3cb0bd2
parent 7be7140e
Loading
Loading
Loading
Loading
+10 −8
Original line number Original line Diff line number Diff line
@@ -398,16 +398,18 @@ class InsetsPolicy {


        if (WindowConfiguration.isFloating(windowingMode)
        if (WindowConfiguration.isFloating(windowingMode)
                || (windowingMode == WINDOWING_MODE_MULTI_WINDOW && isAlwaysOnTop)) {
                || (windowingMode == WINDOWING_MODE_MULTI_WINDOW && isAlwaysOnTop)) {
            if (!stateCopied) {
            InsetsState newState = new InsetsState();
                state = new InsetsState(state);

                stateCopied = true;
            // Only caption and IME are needed.
            if (state.peekSource(ITYPE_CAPTION_BAR) != null) {
                newState.addSource(state.peekSource(ITYPE_CAPTION_BAR));
            }
            }
            state.removeSource(ITYPE_STATUS_BAR);
            if (windowingMode != WINDOWING_MODE_PINNED && state.peekSource(ITYPE_IME) != null) {
            state.removeSource(ITYPE_NAVIGATION_BAR);
                newState.addSource(state.peekSource(ITYPE_IME));
            state.removeSource(ITYPE_EXTRA_NAVIGATION_BAR);
            if (windowingMode == WINDOWING_MODE_PINNED) {
                state.removeSource(ITYPE_IME);
            }
            }

            state = newState;
            stateCopied = true;
        }
        }


        return state;
        return state;