mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Merge "Taskbar fixes when apps move to desktop and back" into tm-qpr-dev
This commit is contained in:
@@ -43,7 +43,7 @@ public class DesktopVisibilityController {
|
||||
*/
|
||||
private boolean isDesktopModeSupported() {
|
||||
return SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false)
|
||||
|| SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
|
||||
|| SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,9 @@ public class DesktopVisibilityController {
|
||||
StatefulActivity<LauncherState> activity =
|
||||
QuickstepLauncher.ACTIVITY_TRACKER.getCreatedActivity();
|
||||
View workspaceView = mLauncher.getWorkspace();
|
||||
if (activity == null || workspaceView == null || !isDesktopModeSupported()) return;
|
||||
if (activity == null || workspaceView == null || !isDesktopModeSupported()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mFreeformTasksVisible) {
|
||||
workspaceView.setVisibility(View.INVISIBLE);
|
||||
@@ -93,7 +95,12 @@ public class DesktopVisibilityController {
|
||||
} else {
|
||||
workspaceView.setVisibility(View.VISIBLE);
|
||||
// If freeform isn't visible ensure that launcher appears resumed to behave normally.
|
||||
activity.setResumed();
|
||||
// Check activity state before calling setResumed(). Launcher may have been actually
|
||||
// paused (eg fullscreen task moved to front).
|
||||
// In this case we should not mark the activity as resumed.
|
||||
if (activity.isResumed()) {
|
||||
activity.setResumed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ import com.android.quickstep.util.SplitSelectStateController;
|
||||
import com.android.quickstep.util.SplitToWorkspaceController;
|
||||
import com.android.quickstep.util.SplitWithKeyboardShortcutController;
|
||||
import com.android.quickstep.util.TISBindHelper;
|
||||
import com.android.quickstep.views.DesktopTaskView;
|
||||
import com.android.quickstep.views.OverviewActionsView;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
import com.android.quickstep.views.TaskView;
|
||||
@@ -663,6 +664,20 @@ public class QuickstepLauncher extends Launcher {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setResumed() {
|
||||
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
|
||||
DesktopVisibilityController controller = mDesktopVisibilityController;
|
||||
if (controller != null && controller.areFreeformTasksVisible()) {
|
||||
// Return early to skip setting activity to appear as resumed
|
||||
// TODO(b/255649902): shouldn't be needed when we have a separate launcher state
|
||||
// for desktop that we can use to control other parts of launcher
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.setResumed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeferredResumed() {
|
||||
super.onDeferredResumed();
|
||||
|
||||
@@ -59,10 +59,14 @@ import java.util.function.Consumer;
|
||||
// TODO(b/249371338): TaskView needs to be refactored to have better support for N tasks.
|
||||
public class DesktopTaskView extends TaskView {
|
||||
|
||||
/** Flag to indicate whether desktop windowing proto 2 is enabled */
|
||||
public static final boolean DESKTOP_IS_PROTO2_ENABLED = SystemProperties.getBoolean(
|
||||
"persist.wm.debug.desktop_mode_2", false);
|
||||
|
||||
/** Flags to indicate whether desktop mode is available on the device */
|
||||
public static final boolean DESKTOP_MODE_SUPPORTED =
|
||||
SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false)
|
||||
|| SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
|
||||
|| DESKTOP_IS_PROTO2_ENABLED;
|
||||
|
||||
private static final String TAG = DesktopTaskView.class.getSimpleName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user