I am building a highly modular system where adding new apps is essentially just a matter of extending the base app class. The core logic is separated into three dedicated managers: DesktopManager, WindowManager, and TaskbarManager.
The DesktopManager is responsible for the desktop surface itself - it handles icon placement, desktop interactions, background rendering, and overall workspace coordination. It manages the representation of available applications and acts as the primary interface for launching and holding new app instances.
The WindowManager controls all window-related behavior, including creation and destruction, focus handling, z-index ordering, dragging, resizing, minimizing, maximizing, and state persistence. Each window represents a running application instance, and the WindowManager ensures correct lifecycle management as well as smooth user interaction.
The TaskbarManager manages the taskbar at the bottom of the screen, displaying running applications, enabling quick switching between them, providing visual feedback for active windows, and handling the dock-style launcher for pinned apps. It effectively serves as the central hub for fast access to both active and favorite applications.