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§
- Pending
Window - One
WindowOpeningcarried through the event loop, taken once by the runner that builds its window. - Window
Opening - A request as it arrived, with the connections it carries.
- Window
Request - The shell’s request to open one more window of the app.
Constants§
- REVEAL_
ENV - The variable a launch names the item its window opens on in, for a process the shell starts for that window rather than one it asks for it: a window door request cannot reach a window that is already being built.
Functions§
- announce
- Say on the door the launcher handed this process that it opens the windows the shell asks for, before the launch’s first window is made: the shell takes a mapped window as proof the app cannot, so an app that answers only once its loop runs keeps a process per window.
- building
- Build the window
openingasks for withbuild: while it runs, the window’s instance and connections stand in for the process’s own. Whatbuilddid 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;Noneonce the shell closed it. - requested_
instance - The instance of the window being built for the shell’s request, while one
is;
Nonewhile the process’s first window is built, and where there is no window door. - requested_
reveal - The item the window being built opens on: what the shell’s request named for a window of a process already running, or, for the process’s first window, the item its launch named it.
- send
- Write
requeston the shell’s end ofdoor, with the connections it says it carries. - serve
- Read
dooron a thread of its own, handing each request toopen, until the shell closes it oropenrefuses (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]), told this app serves windows: the shell routes an app’s later windows to a process that said so before it mapped one. - take_
patch - The patch connection of the window
instance, once the shell sent it; until then,wakeis woken when it arrives. - take_
shell_ ui - The shell-ui connection of the window being built, once.