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

Commit 0d11430e authored by Qi Jing's avatar Qi Jing Committed by Automerger Merge Worker
Browse files

Update LayerVector if the mirrorRoot is already inside am: b8e4c135 am: 2896bca2

parents b5224713 2896bca2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -8471,7 +8471,13 @@ bool SurfaceFlinger::commitMirrorDisplays(VsyncId vsyncId) {
        // Set mirror layer's default layer stack to -1 so it doesn't end up rendered on a display
        // accidentally.
        sp<Layer> rootMirrorLayer = LayerHandle::getLayer(mirrorDisplay.rootHandle);
        rootMirrorLayer->setLayerStack(ui::LayerStack::fromValue(-1));
        ssize_t idx = mCurrentState.layersSortedByZ.indexOf(rootMirrorLayer);
        bool ret = rootMirrorLayer->setLayerStack(ui::LayerStack::fromValue(-1));
        if (idx >= 0 && ret) {
            mCurrentState.layersSortedByZ.removeAt(idx);
            mCurrentState.layersSortedByZ.add(rootMirrorLayer);
        }

        for (const auto& layer : mDrawingState.layersSortedByZ) {
            if (layer->getLayerStack() != mirrorDisplay.layerStack ||
                layer->isInternalDisplayOverlay()) {