Merge pull request #48 from FilipAlexander/pr/wake

Shell: double-tap wake returns to the last app (setting default off)
This commit is contained in:
James Babcock committed 2026-10-17 11:56:48 -07:00
commit e59b3becb4
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";
@@ -1003,7 +1004,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 };
}
@@ -1042,7 +1043,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 };
@@ -1145,6 +1146,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];
}