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

Commit 95136621 authored by chaviw's avatar chaviw
Browse files

Don't update crop WSA when drag resizing so screenshots are correct.

When drag resizing, there's no need to recalculate the crop for
the WSA since it will not be affected by the decor frame.
This is needed to prevent incorrect screenshots when drag
resizing. So for example, if the app was in split screen and
then the user dragged the divider to exit split screen, the WSA
would crop the area where the nav bar is and below. This would cause
the screenshot to get cropped, only showing the area that was last
computed by setSurfaceBoundariesLocked. This isn't necessary since
in drag resizing, the WSA hasn't redrawn yet so there's no need to
recalculate the crop for the area under the nav bar.

Bug: 76442549
Test: Enter split screen. Drag divider to exit. Ensure recents
screenshot is correct and not cropped.

Change-Id: If7f2639794a0c3a20353d40fe31ef9bb9a051e41
parent 0e675bd9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4310,7 +4310,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        // If a freeform window is animating from a position where it would be cutoff, it would be
        // cutoff during the animation. We don't want that, so for the duration of the animation
        // we ignore the decor cropping and depend on layering to position windows correctly.
        final boolean cropToDecor = !(inFreeformWindowingMode() && isAnimatingLw());

        // We also ignore cropping when the window is currently being drag resized in split screen
        // to prevent issues with the crop for screenshot.
        final boolean cropToDecor =
                !(inFreeformWindowingMode() && isAnimatingLw()) && !isDockedResizing();
        if (cropToDecor) {
            // Intersect with the decor rect, offsetted by window position.
            systemDecorRect.intersect(decorRect.left - left, decorRect.top - top,