voelin-gpui: a window that cannot open ends the app with the reason, not a hang
When open_main_window failed (no usable Vulkan or GL driver), run() stored the
error and called cx.quit() inside the launch callback. GPUI's Linux platform
calls that callback before it starts its event loop, and calloop's
EventLoop::run clears its stop signal on entry, so the quit was lost: the
binary stayed alive with no window and no message (reproduced on a private
Xvfb with VK_DRIVER_FILES, __EGL_VENDOR_LIBRARY_DIRS and LIBGL_DRIVERS_PATH
pointing nowhere: exit 124 under `timeout`, nothing in the log after "Creating
colormap"), and the `failure` that main was to print was never returned. The
quit is a foreground task now, which runs inside the loop: the same run exits
with status 1 and "cannot open the main window / Failed to create surface".
With no display server at all GPUI starts its headless platform, whose
open_window succeeds with a window that draws nothing, so the same silent hang
came from there; open_main_window refuses a compositor named "headless" with
"no display: neither DISPLAY nor WAYLAND_DISPLAY names a display server".
tests/launch_failure.rs starts the built binary both ways (the driver case
under VOELIN_X11_TEST_DISPLAY, skipped where the machine's driver is found
anyway; the display case needs none) and fails when the process outlives two
minutes; with the old cx.quit() the driver test fails after 120 s, with the fix
both pass in a third of a second. docs/ui.md ("Running it") says what a missing
driver and a missing display look like; CHANGELOG.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97d51fb226
commit
a4694e944b
4 files changed
+196
-3
No files matched your search
+25
-1
@@ -1005,7 +1005,8 @@ crates/voelin-gpui/
|
||||
and a job from another thread reach the entity; the theme reaches
|
||||
gpui-component, follows the window's appearance and the text size; the
|
||||
Slint file's tokens equal the Rust ones (below); the icons and fonts load.
|
||||
`cargo test -p voelin-gpui`.
|
||||
`tests/launch_failure.rs` starts the built binary where its window cannot
|
||||
open (below). `cargo test -p voelin-gpui`.
|
||||
|
||||
### Running it
|
||||
|
||||
@@ -1024,6 +1025,29 @@ run took is in the log ("Selected GPU adapter: ..."; the default filter shows
|
||||
GPUI's adapter lines: `VOELIN_LOG` or `RUST_LOG` change it). On Wayland and
|
||||
on X11 (a window manager is needed there for fullscreen and close requests).
|
||||
|
||||
A window that cannot open ends the app with the reason and exit status 1; it
|
||||
does not stay up without a window. With no usable driver (none installed, or
|
||||
`VK_DRIVER_FILES` pointing nowhere) the message is
|
||||
|
||||
```
|
||||
Error: cannot open the main window
|
||||
|
||||
Caused by:
|
||||
Failed to create surface: Failed to create surface for any enabled backend: {}
|
||||
```
|
||||
|
||||
and above it the log has the Vulkan loader's own lines (`vkCreateInstance:
|
||||
Found no drivers!`); install a driver or lavapipe. With no display server
|
||||
(neither `DISPLAY` nor `WAYLAND_DISPLAY` set, over ssh for one) it is `cannot
|
||||
open the main window`, caused by `no display: neither DISPLAY nor
|
||||
WAYLAND_DISPLAY names a display server`; GPUI alone would start its headless
|
||||
platform there, which opens windows that draw nothing and runs until it is
|
||||
stopped. `tests/launch_failure.rs` starts the binary both ways (the driver one
|
||||
needs the test display of `VOELIN_X11_TEST_DISPLAY`; it hides the drivers
|
||||
through `VK_DRIVER_FILES`, `__EGL_VENDOR_LIBRARY_DIRS` and
|
||||
`LIBGL_DRIVERS_PATH`, and is skipped where the machine's driver is found
|
||||
anyway).
|
||||
|
||||
| Switch | Does |
|
||||
|---|---|
|
||||
| `VOELIN_OPEN=swatch` | the swatch page in place of the shell; the Slint front end's other pages are not here yet and are named in a warning |
|
||||
|
||||
Reference in new issue
Block a user