feat: separate per-app keep awake from full screen

This commit is contained in:
Blendman974 committed 2026-11-06 03:29:23 +01:00
1 parent 7ba73c7659
commit 772d5e0fe7
7 files changed
+105 -21

No files matched your search

+13 -5
View File
@@ -32,6 +32,8 @@ import { SingleNotificationLayer } from "../notifications";
import {
anthropicApiKeySetting,
appFullscreenSetting,
appKeepAwakeSetting,
toggleSettingMenuItem,
assistantHermesKeySetting,
assistantHermesUrlSetting,
assistantBackendSetting,
@@ -74,8 +76,6 @@ import { BrightnessPickerLayer } from "./brightness-picker-layer";
import { toolRegistry } from "../../assistant/tool-registry";
import {
appViewportRect,
displayLayout,
isImmersive,
minWindowTop,
sidebarWidth,
switcherPosition,
@@ -228,7 +228,7 @@ export type ShellConfig = {
onSwitcherBarHeightChanged?: () => void;
/** A per-app full-screen choice changed the viewport and compositor geometry. */
onWindowLayoutChanged?: () => void;
/** Full screen must not keep the lock screen awake. */
/** An app's keep-awake preference must not keep the lock screen awake. */
isLocked?: () => boolean;
/**
* The Notifications app's window, opened in the background (neither
@@ -882,7 +882,7 @@ class Shell {
if (this.activeVoiceLayer || this.activeKeyboardLayer || this.assistantSession?.isTurnActive() ||
foreground?.isVoiceCapturing?.() || foreground?.keepsScreenOn?.() ||
(foreground?.closeable && !this.config.isLocked?.() &&
(isImmersive(foreground.appId) || displayLayout(foreground.appId) === "fullscreen"))) {
appKeepAwakeSetting(foreground.appId).get())) {
this.lastInputAtMs = nowMs;
return false;
}
@@ -1993,7 +1993,7 @@ class Shell {
const fullscreen = appFullscreenSetting(foreground.appId);
items.push({
label: fullscreen.get() ? "Exit full screen" : "Enter full screen",
description: "Use the whole display and keep it awake while this app is visible.",
description: "Use the whole display for this app.",
onSelect: (ctx) => {
ctx.stack.pop();
if (!this.windows.some(window => window.windowId === foreground.windowId)) return;
@@ -2004,6 +2004,14 @@ class Shell {
this.config.requestShellRender();
},
});
items.push(toggleSettingMenuItem(appKeepAwakeSetting(foreground.appId), {
onChange: (ctx) => {
ctx.stack.pop();
this.noteUserActivity();
this.focusWindow(foreground.windowId);
this.config.requestShellRender();
},
}));
}
if (brightnessSetting.get() !== "auto") {
items.push({