Add useful wayland RAII wrappers

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2026-01-26 18:27:27 +02:00
parent efa6e289b6
commit e04f1cf291
7 changed files with 617 additions and 1 deletions

View File

@@ -539,6 +539,8 @@ Application::Application()
init_input();
init_wayland();
if (m_backend == Backend::SDL)
mouse_captured(true);
@@ -647,6 +649,15 @@ auto Application::init_test_meshes() -> void
m_test_meshes = std::move(*meshes);
}
auto Application::init_wayland() -> void
{
// TODO: Replace with new name, we might have conflicts!
auto const *WAYLAND_SOCKET_NAME { "wayland-5" };
m_wayland.display.add_socket(WAYLAND_SOCKET_NAME);
assert(setenv("WAYLAND_DISPLAY", WAYLAND_SOCKET_NAME, true) == 0);
m_logger.info("Started Wayland display socket on {}", WAYLAND_SOCKET_NAME);
}
auto Application::run() -> void
{