Skip to main content

Module window_door

Module window_door 

Expand description

Every window of an app in a workspace, served by one process.

The shell starts an app once per workspace. When the person opens another window of it there (another tab of Chat, the Lounge’s copy of a window someone else opened), the shell opens it in the running process instead of starting a second one: it writes a WindowRequest on the window door the launcher handed the process (runtime_portal::windows), with the window’s own connections to the session attached, and the process builds the window beside the ones it has. Every window then reads and writes the app’s records through the one store the process holds; a second process could never take that store’s writer lock.

The window is built as the process’s first was, from the same launch: the request only says which window it is (its instance, the durable id its tab keeps), and carries the connections that are the window’s own. While it is built, those stand in for the ones the launcher handed the process (instance, take_collaboration, take_shell_ui).

Structs§

PendingWindow
One WindowOpening carried through the event loop, taken once by the runner that builds its window.
WindowOpening
A request as it arrived, with the connections it carries.
WindowRequest
The shell’s request to open one more window of the app.

Functions§

building
Build the window opening asks for with build: while it runs, the window’s instance and connections stand in for the process’s own. What build did not take is closed after.
instance
The instance of the window being built for a request, if one is.
is_building
Whether a window is being built for a request: its connections are its own, never the ones the launcher handed the process.
receive
The next request on the app’s end of door; None once the shell closed it.
requested_instance
The instance of the window being built for the shell’s request, while one is; None while the process’s first window is built, and where there is no window door.
send
Write request on the shell’s end of door, with the connections it says it carries.
serve
Read door on a thread of its own, handing each request to open, until the shell closes it or open refuses (its loop is gone).
take_collaboration
The collaboration connection of the window being built, once.
take_door
The door the launcher handed this process, once (see [runtime_portal::windows::take_door]).
take_patch
The patch connection of the window instance, once the shell sent it; until then, wake is woken when it arrives.
take_shell_ui
The shell-ui connection of the window being built, once.