Desks: Exclude desk roots when looking for focused desktop tasks
Prior to desktop tasks being organized inside a desk root task, using getRunningTasks with a W_M_FREEFORM was an ok way to identify desktop tasks. However, now that the desk root itself is also a running freeform task, and considering desktop tasks may also soon be W_M_FULLSCREEN, it is better to check the repository for whether a task is a desktop task, regardless of its windowing mode. Also fixes an issue where FocusTransitionObserver considers the desk root task the "focused in display" task even if it contains focused children by: 1) Filtering for leaf tasks 2) Having shell transitions report children as FLAG_MOVED_TO_TOP even if they had already been reported to top, as long as their parent is also to-top and had not been reported before. This fixes an edge case where reparenting an already to-top fullscreen task to a desk that is being brought to front reported only the desk as MOVE_TO_TOP, but the child change was not MOVE_TO_TOP, resulting in FocusTransitionObserver not considering the child as a focus candidate. Flag: com.android.window.flags.exclude_desk_roots_from_desktop_tasks Fix: 417876539 Bug: 405354639 Fix: 413127211 Test: use keyboard shorcut to move task from desk->fullscreen, verify it's the child task that moves to fullscreen, not the desk task Test: same as above, but for a move from desk->split or tiling Test: Open fullscreen task and move to desk with handle menu button - verify the App Header color is that of focused-in-display tasks (more opaque) Change-Id: Ice8a0af90d7a01b3f9a475660053d99a79fa2648
Loading
Please register or sign in to comment