The library throws at a Vulkan error, and a frame's — the device lost,
its memory exhausted — came out of the frame callback with nothing under
it to catch it: std::terminate. The instance was gone with its window,
and every later text imsd had stored waited there, not notified, until
somebody started the app again. A first frame that failed in the window
an Activate had asked for threw into the Activate handler instead and
left an instance with a window it never showed.
The frame path catches it now. The failure is logged and nothing counts
as on screen from there. From the frame callback the window closes as
at the compositor's word: an instance with a session bus runs on
without one, importing and notifying, and one without ends with exit 1.
At Show's first frame the window is taken down at once, and a start
left without a window ends with exit 1. A window asked for while a
failed one waits for its Hide is made after that Hide. The screenshot's
frame is a frame like the others, and a capture finds a window that
failed to be no window.
A failure named VK_ERROR_DEVICE_LOST — the library throws the failed
call's result by its name — means the device is lost. It stays lost,
and the app sets the device up once per process, so this process can
make no window again: the next request for one — at once when the
failure was a window's making or its first frame — ends the instance
in order with exit 1, and the start after it has a new device. That
covers a device lost while there was no window, where the window's
making fails and the instance used to stay, failing every later request
the same way. With the device not lost the next request makes a new
window.
The frame that fails is often the one a text asked for, and that text
was stored read, its conversation counting as on screen. A text made
read — by Sync at its import, by the app at Opened and Reload — is now
kept until the device has answered for the frame after it: the next
frame draws it, if its conversation is still the screen's, and the
library's Render begins by waiting for the frame that had its slot, the
frames in flight before it, so the app asks for that many more frames
and lets the text go when they are drawn. A window that fails before
then, or a device found lost at the next window's making, gives its
texts back: unread again, and notified through main's notifier, whose
bus main flushes before a start's early exit as before the loop's.
Only the frame path's errors are caught. One the library meets under its
own listeners — the swapchain it rebuilds at a resize — is under no
catch of the app's and still ends the process. And a resident instance
whose own start asks for the window (--new) and meets the lost device
there says it quits and runs on until the next request: that quit comes
before the main loop runs, and is lost.
Tested: on KWin, with a Vulkan layer of the bench's that answers
VK_ERROR_DEVICE_LOST from a chosen frame or moment on (the real device
is not lost: the waits a teardown makes fail too), this build beside the
one before. A conversation open and a text for it drawn, then the device
lost and another text for it: before, an abort with that text stored
read; now the first text stays read, the second is unread again and
notified, the next text is notified, an Activate ends the instance with
exit 1, and the start after it has its window. A text whose frame is
handed over and the device lost from the next frame on: unread again and
notified. A text drawn, its window closed before the frames that answer
for it, the device lost, and an Activate: unread again and notified,
exit 1. A plain start whose first frame fails, and a window without a
session bus: exit 1, before an abort. A resident instance whose first
frame fails at an Activate, and one whose device is lost while it has no
window: the Activate ends it with exit 1 and the start after it has its
window, where before the instance stayed and showed none. One frame
alone answering VK_ERROR_OUT_OF_DEVICE_MEMORY: the window goes, its text
is unread and notified, and the next Activate makes a new window, before
an abort; an Activate sent while that frame is still failing is served
after the Hide, and so is a link to another conversation. The
screenshot's frame meeting the lost device: no PNG, exit 1, and a text
waiting for its frames is unread again and notified, where before it
stayed read; a capture that comes due while a frame fails in its submit:
no window, exit 1, before an abort. A text made read as its window
became the active one, the store refusing that write's flush (the bench
fails its fdatasync), and the next frame on the lost device: unread
again and notified; the same text drawn first, its window left and
returned to, and then the loss: it stays read. And the limit: the device
lost and the window resized before a frame — an abort, as before.