From 563b23a33726289387193b85d90fb569631ee05f Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 23:52:22 +0300 Subject: Reconnect to a restarted Wayland compositor Windows now outlive the compositor. On connection loss YASL sends DISPLAY_LOST instead of closing every window, retries the connection on a loop timer, rebuilds each toplevel with its title, size, state and GL context, and sends DISPLAY_RESTORED. CPU windows keep their pixels; GPU renderers drop Vulkan surfaces and GL objects on loss and rebuild them on restore. - Free the dead connection's objects on the next wait, after the application has released GPU objects built on them. - Report a lost connection as an event rather than a failed wait. - Refuse window and Vulkan surface creation while offline with the new YASL_ERROR_DISCONNECTED. - Close popups, cancel drags and fail pending clipboard requests on loss. - Print only protocol errors, not ordinary disconnects. - Examples survive a restart; game.c rebinds its GL context. - Add an end-to-end test that kills Weston under CPU, GL and Vulkan windows and requires them to recover. Co-Authored-By: Claude Opus 5.5 --- docs/getting-started.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs/getting-started.md') diff --git a/docs/getting-started.md b/docs/getting-started.md index bb7f095..b82dae5 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -48,8 +48,13 @@ there is no public display/context object. Closing the final window does not implicitly terminate the application or reset configuration. `yasl_shutdown` releases shared resources and restores defaults. -[hello.c](../examples/hello.c) draws into a CPU surface's pixel buffer on every REFRESH. [game.c](../examples/game.c) creates a GL context, binds it, -loads procedures, draws, and swaps. [tablet.c](../examples/tablet.c) retains a canvas +If the Wayland compositor restarts, windows stay open: YASL sends DISPLAY_LOST, +reconnects, and sends DISPLAY_RESTORED. CPU windows need nothing; GPU renderers drop +their Vulkan surfaces and GL objects on loss and rebuild them on restore. + +[hello.c](../examples/hello.c) draws into a CPU surface's pixel buffer on every REFRESH. +[game.c](../examples/game.c) creates a GL context, binds it, loads procedures, draws, +swaps, and rebinds the context after a compositor restart. [tablet.c](../examples/tablet.c) retains a canvas and draws pressure-sensitive pen/eraser strokes. [notepad.c](../examples/notepad.c) uses a worker queue, wakeups, clipboard, IME, and its own blink deadline. -- cgit v1.2.3