From d5a62cc6f5005c548bf1647101bba83e679b348e Mon Sep 17 00:00:00 2001 From: TMC Date: Thu, 12 Nov 2026 13:04:33 +0100 Subject: [PATCH] Redraw every open copy of the launcher when a setting changes Opening the launcher like an app (the installer's "Open") and then making it the home app leaves two launcher activities in one process. A changed setting recreated whichever one LawnchairApp.launcher returned, which could be the one in the background, so the home screen kept its old look until a restart. Co-Authored-By: Claude Fable 5.2 --- lawnchair/src/app/lawnchair/LawnchairApp.kt | 12 ++++++++++++ lawnchair/src/app/lawnchair/LawnchairLauncher.kt | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lawnchair/src/app/lawnchair/LawnchairApp.kt b/lawnchair/src/app/lawnchair/LawnchairApp.kt index 4873fe2839..acb17dd5b1 100644 --- a/lawnchair/src/app/lawnchair/LawnchairApp.kt +++ b/lawnchair/src/app/lawnchair/LawnchairApp.kt @@ -214,6 +214,10 @@ class LawnchairApp : LauncherApplication() { val launcher: LawnchairLauncher? get() = activities.filterIsInstance().firstOrNull() + // Flexera Launcher: see LawnchairApp.launchers. + val launchers: List + get() = activities.filterIsInstance() + fun finishAll() { HashSet(activities).forEach { it.finish() } } @@ -292,6 +296,14 @@ class LawnchairApp : LauncherApplication() { @JvmStatic val launcher: LawnchairLauncher? get() = instance.activityHandler.launcher + /** + * Flexera Launcher: every copy of the launcher that is open. There are two when it was + * opened like an app (from the installer's "Open", say) and then made the home app: one + * in the app's own task and one as the home screen. [launcher] picks either of them. + */ + @JvmStatic + val launchers: List get() = instance.activityHandler.launchers + @OptIn(ExperimentalMaterial3ExpressiveApi::class, ExperimentalMaterial3Api::class) fun Launcher.showQuickstepWarningIfNecessary() { val launcher = this diff --git a/lawnchair/src/app/lawnchair/LawnchairLauncher.kt b/lawnchair/src/app/lawnchair/LawnchairLauncher.kt index fa31c2400b..77264a141c 100644 --- a/lawnchair/src/app/lawnchair/LawnchairLauncher.kt +++ b/lawnchair/src/app/lawnchair/LawnchairLauncher.kt @@ -517,7 +517,10 @@ class LawnchairLauncher : QuickstepLauncher() { fun recreateIfNotScheduled() { if (sRestartFlags == 0) { - recreate() + // Flexera Launcher: every open copy, not only this one. A changed setting used to + // rebuild whichever copy LawnchairApp.launcher happened to return, which could be + // the one in the background, and the home screen kept its old look until restart. + (LawnchairApp.launchers + this).distinct().forEach { it.recreate() } } }