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

Commit f145b362 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fall back to system DEFAULT_DISPLAY on disconnect if needed." into main

parents 6c27a6b3 b79009dd
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -699,8 +699,12 @@ class DesktopTasksController(
    /** Start a disconnect transition directly in Shell. */
    fun disconnectDisplay(disconnectedDisplayId: Int) {
        logD("disconnectDisplay: disconnectedDisplayId=$disconnectedDisplayId")
        val disconnectReparentDisplay =
        var disconnectReparentDisplay =
            UserManager.get(userProfileContexts.userContext).mainDisplayIdAssignedToUser
        // If user has no default display configured, fall back to DEFAULT_DISPLAY
        if (disconnectReparentDisplay == INVALID_DISPLAY) {
            disconnectReparentDisplay = DEFAULT_DISPLAY
        }
        val wct = WindowContainerTransaction()
        val runOnTransitStart =
            addOnDisplayDisconnectChanges(wct, disconnectedDisplayId, disconnectReparentDisplay)