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 { export class ScreenManager {
private window: BrowserWindow; private window: BrowserWindow;
private idleTimeout: number = 300000; // 5 minutes default
private idleTimer: NodeJS.Timeout | null = null; private idleTimer: NodeJS.Timeout | null = null;
private isScreenOn: boolean = true; private isScreenOn: boolean = true;
private lastActivity: number = Date.now();
private screenControlAvailable: boolean = true; private screenControlAvailable: boolean = true;
private isWayland: boolean = false; private isWayland: boolean = false;
@@ -23,7 +21,8 @@ export class ScreenManager {
this.window = window; this.window = window;
this.detectDisplayServer(); this.detectDisplayServer();
this.setupActivityListeners(); this.setupActivityListeners();
this.startIdleMonitor(); // Idle monitor intentionally disabled: monitor stays on; photo frame
// handles the visual idle state instead.
} }
private detectDisplayServer(): void { private detectDisplayServer(): void {
@@ -44,31 +43,19 @@ export class ScreenManager {
// Called from renderer when touch/click detected // Called from renderer when touch/click detected
public handleUserActivity(): void { public handleUserActivity(): void {
this.lastActivity = Date.now();
// Always try to wake the screen on touch/click - user is actively interacting
if (!this.isScreenOn) { if (!this.isScreenOn) {
this.wakeScreen(); 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 { private resetIdleTimer(): void {
this.lastActivity = Date.now();
if (!this.isScreenOn) { if (!this.isScreenOn) {
this.wakeScreen(); this.wakeScreen();
} }
} }
setIdleTimeout(timeout: number): void { setIdleTimeout(_timeout: number): void {
this.idleTimeout = timeout; // no-op: idle monitor is disabled; monitor stays on
} }
async wakeScreen(): Promise<void> { async wakeScreen(): Promise<void> {
@@ -164,7 +151,6 @@ export class ScreenManager {
} }
this.isScreenOn = true; this.isScreenOn = true;
this.lastActivity = Date.now();
this.window.webContents.send('screen:woke'); this.window.webContents.send('screen:woke');
} catch (error) { } catch (error) {
console.error('Failed to wake screen:', error); console.error('Failed to wake screen:', error);

View File

@@ -100,14 +100,14 @@ function DashboardContent() {
const config = useSettingsStore((state) => state.config); const config = useSettingsStore((state) => state.config);
return ( return (
<div className="col-span-12 flex flex-col gap-3 min-h-0"> <div className="col-span-12 flex flex-row gap-3 min-h-0">
{config.calendar && ( {config.calendar && (
<div className="flex-[9] min-h-0"> <div className="flex-[9] min-w-0">
<CalendarWidget /> <CalendarWidget />
</div> </div>
)} )}
{config.todoList && ( {config.todoList && (
<div className="flex-[1] min-h-0"> <div className="flex-[1] min-w-0">
<TodoWidget /> <TodoWidget />
</div> </div>
)} )}