Skip to content

Window Manager: Make CGS initialization delay adaptive #108

@malpern

Description

@malpern

Problem

Hardcoded 2-second delay in WindowManager initialization may be insufficient for slow systems or wasteful for fast systems.

Location

App.swift

try? await Task.sleep(nanoseconds: 2_000_000_000) // 2s delay
await WindowManager.shared.initializeWithRetry()

Impact

Slow systems may fail initialization, fast systems waste 2 seconds at startup.

Fix

  1. Make delay adaptive based on system responsiveness
  2. Implement proper readiness check instead of fixed delay
  3. Consider exponential backoff with faster initial attempts

References

  • Comprehensive review: docs/code-review/comprehensive-feature-review.md section 8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions