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

Commit 17690ffc authored by Skuhne's avatar Skuhne
Browse files

Dont update thumbnails of freeform windows on focus change

Windows should not update their thumbnails upon a focus change since
it costs a lot of time to capture the content and the thumbnail would
be outdated short time later anyways since the window is still
visible anyways.

Bug: 23562904
Change-Id: If5d23a1058e83030770905827d682f649a579f7a
parent 306a1d22
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -902,7 +902,14 @@ final class ActivityStack {
        prev.task.touchActiveTime();
        clearLaunchTime(prev);
        final ActivityRecord next = mStackSupervisor.topRunningActivityLocked();
        if (mService.mHasRecents && (next == null || next.noDisplay || next.task != prev.task || uiSleeping)) {
        // In freeform mode we only update the thumbnail when there is no thumbnail yet since every
        // focus change will request a thumbnail to be taken.
        // Note furthermore that since windows can change their content in freeform mode all the
        // time a thumbnail is possibly constantly outdated.
        if (mService.mHasRecents &&
                (next == null || next.noDisplay || next.task != prev.task || uiSleeping) &&
                (!prev.task.hasThumbnail() ||
                        prev.task.stack.mStackId != FREEFORM_WORKSPACE_STACK_ID)) {
            prev.updateThumbnailLocked(screenshotActivities(prev), null);
        }
        stopFullyDrawnTraceIfNeeded();
+8 −0
Original line number Diff line number Diff line
@@ -477,6 +477,14 @@ final class TaskRecord {
        setNextAffiliate(null);
    }

    /**
     * Returns true when we have a thumbnail.
     * @return Returns true if there is a thumbnail.
     */
    boolean hasThumbnail() {
        return mLastThumbnail != null;
    }

    /**
     * Sets the last thumbnail.
     * @return whether the thumbnail was set