diff --git a/electron/services/ScreenManager.ts b/electron/services/ScreenManager.ts index fe06039..4932070 100644 --- a/electron/services/ScreenManager.ts +++ b/electron/services/ScreenManager.ts @@ -12,10 +12,8 @@ const DBUS_ENV = { export class ScreenManager { private window: BrowserWindow; - private idleTimeout: number = 300000; // 5 minutes default private idleTimer: NodeJS.Timeout | null = null; private isScreenOn: boolean = true; - private lastActivity: number = Date.now(); private screenControlAvailable: boolean = true; private isWayland: boolean = false; @@ -23,7 +21,8 @@ export class ScreenManager { this.window = window; this.detectDisplayServer(); this.setupActivityListeners(); - this.startIdleMonitor(); + // Idle monitor intentionally disabled: monitor stays on; photo frame + // handles the visual idle state instead. } private detectDisplayServer(): void { @@ -44,31 +43,19 @@ export class ScreenManager { // Called from renderer when touch/click detected public handleUserActivity(): void { - this.lastActivity = Date.now(); - // Always try to wake the screen on touch/click - user is actively interacting if (!this.isScreenOn) { this.wakeScreen(); } } - private startIdleMonitor(): void { - this.idleTimer = setInterval(() => { - const idleTime = Date.now() - this.lastActivity; - if (idleTime >= this.idleTimeout && this.isScreenOn && this.screenControlAvailable) { - this.sleepScreen(); - } - }, 30000); // Check every 30 seconds (not 10) to reduce spam - } - private resetIdleTimer(): void { - this.lastActivity = Date.now(); if (!this.isScreenOn) { this.wakeScreen(); } } - setIdleTimeout(timeout: number): void { - this.idleTimeout = timeout; + setIdleTimeout(_timeout: number): void { + // no-op: idle monitor is disabled; monitor stays on } async wakeScreen(): Promise { @@ -164,7 +151,6 @@ export class ScreenManager { } this.isScreenOn = true; - this.lastActivity = Date.now(); this.window.webContents.send('screen:woke'); } catch (error) { console.error('Failed to wake screen:', error); diff --git a/src/App.tsx b/src/App.tsx index 0700957..fc9a912 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -100,14 +100,14 @@ function DashboardContent() { const config = useSettingsStore((state) => state.config); return ( -
+
{config.calendar && ( -
+
)} {config.todoList && ( -
+
)}