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

Commit 1a20f184 authored by Kriti Dang's avatar Kriti Dang
Browse files

Ignore the preferredModeId for non-focussed windows

If a window sets preferredModeId, and then enters pip mode. Then if the
mode/refresh-rate/resolution is chosen by user from Settings menu, it doesn't take
effect because of preferredModeId of the pip window.

Bug: 232711732
Test: atest DisplayContentTests
Change-Id: Ief48c38ff9dc85c9033d502cc4006130678ae808
Merged-In: Ief48c38ff9dc85c9033d502cc4006130678ae808
(cherry picked from commit 3f864738)
parent 6f8ed225
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -946,7 +946,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp

                final int preferredModeId = getDisplayPolicy().getRefreshRatePolicy()
                        .getPreferredModeId(w);
                if (mTmpApplySurfaceChangesTransactionState.preferredModeId == 0
                if (w.isFocused() && mTmpApplySurfaceChangesTransactionState.preferredModeId == 0
                        && preferredModeId != 0) {
                    mTmpApplySurfaceChangesTransactionState.preferredModeId = preferredModeId;
                }