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

Commit 0578b727 authored by Chris Li's avatar Chris Li
Browse files

Do not crop activity surface in transitions setup

Activity may have letterbox as child surface positioned at a negative
coordinates related to the activity's surface. As a result, we don't
want to set window crop on activity.

Bug: 381193234
Test: verify with example app in the bug
Flag: EXEMPT bug fix
Change-Id: Ie021dfadf981026047c9a91f956caf875019540f
parent 50119482
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -546,9 +546,14 @@ public class Transitions implements RemoteCallable<Transitions>,
                // When the window is moved to front, make sure the crop is updated to prevent it
                // from using the old crop.
                t.setPosition(leash, change.getEndRelOffset().x, change.getEndRelOffset().y);
                if (change.getContainer() != null) {
                    // We don't want to crop on non-remotable (activity), because it can have
                    // letterbox child surface that is position at a negative position related to
                    // the activity's surface.
                    t.setWindowCrop(leash, change.getEndAbsBounds().width(),
                            change.getEndAbsBounds().height());
                }
            }

            // Don't move anything that isn't independent within its parents
            if (!TransitionInfo.isIndependent(change, info)) {
@@ -557,9 +562,14 @@ public class Transitions implements RemoteCallable<Transitions>,
                    t.setMatrix(leash, 1, 0, 0, 1);
                    t.setAlpha(leash, 1.f);
                    t.setPosition(leash, change.getEndRelOffset().x, change.getEndRelOffset().y);
                    if (change.getContainer() != null) {
                        // We don't want to crop on non-remotable (activity), because it can have
                        // letterbox child surface that is position at a negative position related
                        // to the activity's surface.
                        t.setWindowCrop(leash, change.getEndAbsBounds().width(),
                                change.getEndAbsBounds().height());
                    }
                }
                continue;
            }