From fee9dfac77df5f4fa904f1185d528bbad644e805 Mon Sep 17 00:00:00 2001 From: FilipAlexander <55953550+FilipAlexander@users.noreply.github.com> Date: Sat, 17 Oct 2026 16:42:32 +0200 Subject: [PATCH] Shell: double-tap wake returns to the last app A double tap that wakes the display (a screen-off double-click, or the firmware's display-wake) now focuses the foreground window instead of the app switcher. "Wake into last app" (Display settings, on by default) turns it back to the switcher. Lock screen, put-on, notification and wakeword wakes are unchanged. Co-Authored-By: Claude Opus 5.5 --- app/g2/dashboard-controller.ts | 2 +- app/ui/dashboard-settings.ts | 8 ++++++++ app/ui/dashboard/settings-menus.ts | 2 ++ app/ui/shell/shell.ts | 10 ++++++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index 1decb897..088196b1 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -2306,7 +2306,7 @@ class DashboardController { let shellPreWoke = false; if (wakewordShouldWake || displayShouldWake) { if (!shell.isScreenOn()) { - shellPreWoke = shell.wake("sidebar"); + shellPreWoke = shell.wake(displayShouldWake ? shell.userWakeFocus() : "sidebar"); } if (shellPreWoke || this.evenHubSessionSuspended || this.evenHubResumePromise) { const ready = await frameTimings.spanAsync(frameId, "wake-barrier", () => diff --git a/app/ui/dashboard-settings.ts b/app/ui/dashboard-settings.ts index 083291fe..e92e5b1a 100644 --- a/app/ui/dashboard-settings.ts +++ b/app/ui/dashboard-settings.ts @@ -570,6 +570,14 @@ export function getBrightnessPreferences() { curve: autoBrightnessCurveSetting.getValidValue(), fadeMs: scaleAnimationDuration(SCREEN_FADE_MS, screenFadeSetting.get()) }; } +export const wakeToLastAppSetting = new ConfigSettingBoolean({ + id: "wake-to-last-app", + label: "Wake into last app", + storageKey: "display.wakeToLastApp", + defaultValue: true, + description: "Waking the display with a double tap returns to the app you were using. Off: wake into the app switcher.", +}); + export const screenTimeoutSetting = new ConfigSettingEnum({ id: "screen-timeout", label: "Screen timeout", diff --git a/app/ui/dashboard/settings-menus.ts b/app/ui/dashboard/settings-menus.ts index 92833593..b80390e4 100644 --- a/app/ui/dashboard/settings-menus.ts +++ b/app/ui/dashboard/settings-menus.ts @@ -75,6 +75,7 @@ import { useMicControlSetting, voiceProviderSetting, screenTimeoutSetting, + wakeToLastAppSetting, wakeWordActionSetting, watchCanUnlockSetting, watchCrownClockwiseNextSetting, @@ -106,6 +107,7 @@ function settingsSections(): SettingsSection[] { }, }), toggleSettingMenuItem(lockScreenEnabledSetting), + toggleSettingMenuItem(wakeToLastAppSetting), // A band (at one of five heights) / Tall / Full Screen; the // dashboard controller moves or reflows windows on change. enumSettingMenuItem(displayLayoutSetting), diff --git a/app/ui/shell/shell.ts b/app/ui/shell/shell.ts index 001adcbb..e8336121 100644 --- a/app/ui/shell/shell.ts +++ b/app/ui/shell/shell.ts @@ -45,6 +45,7 @@ import { statusBarVisibilitySetting, timeFormatSetting, wakeWordActionSetting, + wakeToLastAppSetting, windowBorderSetting, } from "../dashboard-settings"; import { onAmbientCardsChanged } from "./ambient-cards"; @@ -966,7 +967,7 @@ class Shell { // "wake". Keep that directionality if delivery is delayed or duplicated. if (event.type === "display-wake") { this.lastInputAtMs = Date.now(); - const wokeScreen = !this.screenOn && this.wake("sidebar"); + const wokeScreen = !this.screenOn && this.wake(this.userWakeFocus()); return { shell: wokeScreen, window: false }; } @@ -1005,7 +1006,7 @@ class Shell { if (!this.screenOn) { if (event.type === "double-click") { - this.wake("sidebar"); + this.wake(this.userWakeFocus()); return { shell: true, window: false }; } return { shell: false, window: false }; @@ -1108,6 +1109,11 @@ class Shell { return { shell: false, window: false }; } + /** Where a user's double-tap wake lands: the last app, or the switcher (setting). */ + userWakeFocus(): FocusKind { + return wakeToLastAppSetting.get() && this.foregroundWindow() ? "window" : "sidebar"; + } + foregroundWindow(): ShellWindow | undefined { return this.windows[this.selectedIndex] ?? this.windows[0]; }