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 <noreply@anthropic.com>
This commit is contained in:
FilipAlexanderandClaude Opus 5.5 committed 2026-10-17 16:42:41 +02:00
1 parent 2bb7b3ea1a
commit fee9dfac77
4 files changed
+19 -3

No files matched your search

+8 -2
View File
@@ -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];
}