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

Commit 8a8e85c4 authored by Matt Sziklay's avatar Matt Sziklay Committed by Android (Google) Code Review
Browse files

Merge "On display disconnect, check for global focused task in desk." into main

parents d1cc7535 18271954
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -695,12 +695,9 @@ class DesktopTasksController(
            if (desktopModeSupportedOnDisplay) {
                // Desktop supported on display; reparent desks, focused desk on top.
                for (deskId in deskIds) {
                    val toTop =
                        desktopRepository
                            .getActiveTasks(disconnectedDisplayId)
                            .contains(focusTransitionObserver.globallyFocusedTaskId)
                    val deskTasks = desktopRepository.getActiveTaskIdsInDesk(deskId)
                    // Remove desk if it's empty.
                    if (desktopRepository.getActiveTasks(disconnectedDisplayId).isEmpty()) {
                    if (deskTasks.isEmpty()) {
                        desksOrganizer.removeDesk(wct, deskId, desktopRepository.userId)
                        desksTransitionObserver.addPendingTransition(
                            DeskTransition.RemoveDesk(
@@ -714,6 +711,8 @@ class DesktopTasksController(
                        )
                    } else {
                        // Otherwise, reparent it to the destination display.
                        val toTop =
                            deskTasks.contains(focusTransitionObserver.globallyFocusedTaskId)
                        desksOrganizer.moveDeskToDisplay(wct, deskId, destinationDisplayId, toTop)
                        desksTransitionObserver.addPendingTransition(
                            DeskTransition.ChangeDeskDisplay(