Skip to content

Apps and windows

An app is anything that opens in a window: Messenger’s contact list, a conversation, Notepad, a Properties dialog, Retro Internet Explorer. A window is one open instance of an app, managed by the window manager.

Every app is an entry in APPS in apps/web/src/apps/registry.tsx, keyed by its kind:

notepad: {
component: NotepadApp, // React, given { windowId, params }
window: { title: 'Untitled - Notepad', icon: 'notepad', width: 520, height: 400, persistKey: 'notepad' },
launcher: [{ label: 'Notepad', icon: 'notepad', folder: 'Accessories', desktop: 8 }],
fileTypes: [{ extensions: ['txt', 'log'], label: 'Text Document', icon: 'textDocument' }],
openWith: { label: 'Notepad', icon: 'notepad', anyFile: true },
}
Field What it does
component What the window renders. It gets the window’s id and its params.
window How a new window opens. Can be a function of params.
launcher Where it appears: Start menu, All Programs folder, pinned list, desktop icon
fileTypes File extensions it opens when someone double-clicks a file
openWith How it is listed in a file’s Open With menu

The Start menu, the desktop icons and double-clicking a file all read the registry, so adding an entry is the whole job of making an app startable. See Add an app.

The window manager (apps/web/src/wm/) keeps every window in one store: position, size, z-order, focus, minimized and maximized state, and taskbar grouping.

  • singletonKey: opening an app with a key that’s already open focuses that window instead of opening a second. A conversation’s key is its conversation id.
  • persistKey: the window remembers where it was left.
  • group: taskbar buttons with the same group stack together.
  • owner and modal: a dialog belongs to a window and can block it.
  • shape: 'dialog': sized to its content, with dialog chrome.

Windows are drawn with WindowFrame from Luna UI.