Don't fail on startup when input device(s) are not present
The wl_seat protocol may not be available unless input devices (keyboard, mouse) are connected to the compositor on the target system. Warn but continue executing examples with default settings.
This commit is contained in:
parent
2d47dc6e9c
commit
b212fa0840
1 changed files with 8 additions and 2 deletions
|
|
@ -842,7 +842,8 @@ VulkanExampleBase::~VulkanExampleBase()
|
|||
wl_keyboard_destroy(keyboard);
|
||||
if (pointer)
|
||||
wl_pointer_destroy(pointer);
|
||||
wl_seat_destroy(seat);
|
||||
if (seat)
|
||||
wl_seat_destroy(seat);
|
||||
xdg_wm_base_destroy(shell);
|
||||
wl_compositor_destroy(compositor);
|
||||
wl_registry_destroy(registry);
|
||||
|
|
@ -2128,12 +2129,17 @@ void VulkanExampleBase::initWaylandConnection()
|
|||
wl_registry_add_listener(registry, ®istry_listener, this);
|
||||
wl_display_dispatch(display);
|
||||
wl_display_roundtrip(display);
|
||||
if (!compositor || !shell || !seat)
|
||||
if (!compositor || !shell)
|
||||
{
|
||||
std::cout << "Could not bind Wayland protocols!\n";
|
||||
fflush(stdout);
|
||||
exit(1);
|
||||
}
|
||||
if (!seat)
|
||||
{
|
||||
std::cout << "WARNING: Input handling not available!\n";
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanExampleBase::setSize(int width, int height)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue