Keep monitor always on and switch Home layout to horizontal 90/10

- Removed ScreenManager idle sleep entirely (constructor no longer starts
  the idle monitor, setIdleTimeout is now a no-op, unused fields and the
  private startIdleMonitor method removed). Display never sleeps; the
  photo frame provides the idle visual instead.
- DashboardContent now uses flex-row: calendar 90% wide, todo 10% wide.
This commit is contained in:
root
2026-04-14 16:29:58 -05:00
parent 7886e72f38
commit cede430dc9
2 changed files with 7 additions and 21 deletions

View File

@@ -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<void> {
@@ -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);